Merge pull request #5718 from mtmiller/update-cmd-opts

Add `brew update -f` option and improve help string format
This commit is contained in:
Mike McQuaid 2019-03-17 12:40:26 +00:00 committed by GitHub
commit 417a16fbaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -3,7 +3,10 @@
#: Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations. #: Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
#: #:
#: --merge `git merge` is used to include updates (rather than `git rebase`). #: --merge `git merge` is used to include updates (rather than `git rebase`).
#: --force Always do a slower, full update check (even if unnecessary). #: -f, --force Always do a slower, full update check (even if unnecessary).
#: -v, --verbose Print the directories checked and `git` operations performed.
#: -d, --debug Display a trace of all shell commands as they are executed.
#: -h, --help Show this message.
# Don't need shellcheck to follow this `source`. # Don't need shellcheck to follow this `source`.
# shellcheck disable=SC1090 # shellcheck disable=SC1090
@ -306,6 +309,7 @@ homebrew-update() {
-*) -*)
[[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1 [[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1 [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
[[ "$option" = *f* ]] && HOMEBREW_UPDATE_FORCE=1
;; ;;
*) *)
odie <<EOS odie <<EOS

View File

@ -195,7 +195,12 @@ module Homebrew
line = line.slice(4..-1) line = line.slice(4..-1)
next unless line next unless line
lines << line.gsub(/^ +(-+[a-z-]+) */, "* `\\1`:\n ") # Omit the common global_options documented separately in the man page.
next if line =~ /--(debug|force|help|quiet|verbose) /
# Format one option or a comma-separated pair of short and long options.
lines << line.gsub(/^ +(-+[a-z-]+), (-+[a-z-]+) +/, "* `\\1`, `\\2`:\n ")
.gsub(/^ +(-+[a-z-]+) +/, "* `\\1`:\n ")
end end
lines lines
end end

View File

@ -540,9 +540,6 @@ Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1)
* `--merge`: * `--merge`:
`git merge` is used to include updates (rather than `git rebase`). `git merge` is used to include updates (rather than `git rebase`).
* `--force`:
Always do a slower, full update check (even if unnecessary).
### `update-reset` [*`repository`*] ### `update-reset` [*`repository`*]
Fetches and resets Homebrew and all tap repositories (or any specified `repository`) using `git`(1) to their latest `origin/master`. Note this will destroy all your uncommitted or committed changes. Fetches and resets Homebrew and all tap repositories (or any specified `repository`) using `git`(1) to their latest `origin/master`. Note this will destroy all your uncommitted or committed changes.

View File

@ -660,10 +660,6 @@ Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\f
\fB\-\-merge\fR \fB\-\-merge\fR
\fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\. \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\.
. .
.TP
\fB\-\-force\fR
Always do a slower, full update check (even if unnecessary)\.
.
.SS "\fBupdate\-reset\fR [\fIrepository\fR]" .SS "\fBupdate\-reset\fR [\fIrepository\fR]"
Fetches and resets Homebrew and all tap repositories (or any specified \fBrepository\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. Fetches and resets Homebrew and all tap repositories (or any specified \fBrepository\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\.
. .