cmd/help: add description and arguments.

This allows an accurate manpage description of `brew help`.

Also commit the various other required changes to completions and
manpage.
This commit is contained in:
Mike McQuaid 2024-04-08 13:35:25 +01:00
parent 138b7b2e4b
commit 5c48226018
No known key found for this signature in database
6 changed files with 29 additions and 20 deletions

View File

@ -7,6 +7,14 @@ require "help"
module Homebrew module Homebrew
module Cmd module Cmd
class HelpCmd < AbstractCommand class HelpCmd < AbstractCommand
cmd_args do
description <<~EOS
Outputs the usage instructions for `brew` <command>.
Equivalent to `brew --help` <command>.
EOS
named_args [:command]
end
sig { override.void } sig { override.void }
def run def run
Help.help Help.help

View File

@ -2107,9 +2107,7 @@ _brew_tap() {
--debug --debug
--eval-all --eval-all
--force --force
--force-auto-update
--help --help
--no-force-auto-update
--quiet --quiet
--repair --repair
--verbose --verbose

View File

@ -941,7 +941,7 @@ __fish_brew_complete_cmd 'lc' 'Check for newer versions of formulae and/or casks
__fish_brew_complete_arg 'lc' -l cask -d 'Only check casks' __fish_brew_complete_arg 'lc' -l cask -d 'Only check casks'
__fish_brew_complete_arg 'lc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'lc' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'lc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them' __fish_brew_complete_arg 'lc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them'
__fish_brew_complete_arg 'lc' -l extract-plist -d 'Include casks using the ExtractPlist livecheck strategy' __fish_brew_complete_arg 'lc' -l extract-plist -d 'Enable checking multiple casks with ExtractPlist strategy'
__fish_brew_complete_arg 'lc' -l formula -d 'Only check formulae' __fish_brew_complete_arg 'lc' -l formula -d 'Only check formulae'
__fish_brew_complete_arg 'lc' -l full-name -d 'Print formulae and casks with fully-qualified names' __fish_brew_complete_arg 'lc' -l full-name -d 'Print formulae and casks with fully-qualified names'
__fish_brew_complete_arg 'lc' -l help -d 'Show this message' __fish_brew_complete_arg 'lc' -l help -d 'Show this message'
@ -1012,7 +1012,7 @@ __fish_brew_complete_cmd 'livecheck' 'Check for newer versions of formulae and/o
__fish_brew_complete_arg 'livecheck' -l cask -d 'Only check casks' __fish_brew_complete_arg 'livecheck' -l cask -d 'Only check casks'
__fish_brew_complete_arg 'livecheck' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'livecheck' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'livecheck' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them' __fish_brew_complete_arg 'livecheck' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them'
__fish_brew_complete_arg 'livecheck' -l extract-plist -d 'Include casks using the ExtractPlist livecheck strategy' __fish_brew_complete_arg 'livecheck' -l extract-plist -d 'Enable checking multiple casks with ExtractPlist strategy'
__fish_brew_complete_arg 'livecheck' -l formula -d 'Only check formulae' __fish_brew_complete_arg 'livecheck' -l formula -d 'Only check formulae'
__fish_brew_complete_arg 'livecheck' -l full-name -d 'Print formulae and casks with fully-qualified names' __fish_brew_complete_arg 'livecheck' -l full-name -d 'Print formulae and casks with fully-qualified names'
__fish_brew_complete_arg 'livecheck' -l help -d 'Show this message' __fish_brew_complete_arg 'livecheck' -l help -d 'Show this message'
@ -1409,9 +1409,7 @@ __fish_brew_complete_arg 'tap' -l custom-remote -d 'Install or change a tap with
__fish_brew_complete_arg 'tap' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'tap' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'tap' -l eval-all -d 'Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'tap' -l eval-all -d 'Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `HOMEBREW_EVAL_ALL` is set'
__fish_brew_complete_arg 'tap' -l force -d 'Force install core taps even under API mode' __fish_brew_complete_arg 'tap' -l force -d 'Force install core taps even under API mode'
__fish_brew_complete_arg 'tap' -l force-auto-update -d 'Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)'
__fish_brew_complete_arg 'tap' -l help -d 'Show this message' __fish_brew_complete_arg 'tap' -l help -d 'Show this message'
__fish_brew_complete_arg 'tap' -l no-force-auto-update -d 'Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)'
__fish_brew_complete_arg 'tap' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'tap' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'tap' -l repair -d 'Migrate tapped formulae from symlink-based to directory-based structure' __fish_brew_complete_arg 'tap' -l repair -d 'Migrate tapped formulae from symlink-based to directory-based structure'
__fish_brew_complete_arg 'tap' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'tap' -l verbose -d 'Make some output more verbose'

View File

@ -173,6 +173,7 @@ __brew_internal_commands() {
'generate-formula-api:Generate `homebrew/core` API data files for https://formulae.brew.sh' 'generate-formula-api:Generate `homebrew/core` API data files for https://formulae.brew.sh'
'generate-man-completions:Generate Homebrew'\''s manpages and shell completions' 'generate-man-completions:Generate Homebrew'\''s manpages and shell completions'
'gist-logs:Upload logs for a failed build of formula to a new Gist' 'gist-logs:Upload logs for a failed build of formula to a new Gist'
'help:Outputs the usage instructions for `brew` command'
'home:Open a formula or cask'\''s homepage in a browser, or open Homebrew'\''s own homepage if no argument is provided' 'home:Open a formula or cask'\''s homepage in a browser, or open Homebrew'\''s own homepage if no argument is provided'
'info:Display brief statistics for your Homebrew installation' 'info:Display brief statistics for your Homebrew installation'
'install:Install a formula or cask' 'install:Install a formula or cask'
@ -1168,7 +1169,7 @@ _brew_lc() {
_arguments \ _arguments \
'(--json)--debug[Display any debugging information]' \ '(--json)--debug[Display any debugging information]' \
'(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \ '(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \
'(--formula)--extract-plist[Include casks using the ExtractPlist livecheck strategy]' \ '(--formula)--extract-plist[Enable checking multiple casks with ExtractPlist strategy]' \
'--full-name[Print formulae and casks with fully-qualified names]' \ '--full-name[Print formulae and casks with fully-qualified names]' \
'--help[Show this message]' \ '--help[Show this message]' \
'(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \ '(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \
@ -1255,7 +1256,7 @@ _brew_livecheck() {
_arguments \ _arguments \
'(--json)--debug[Display any debugging information]' \ '(--json)--debug[Display any debugging information]' \
'(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \ '(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \
'(--formula)--extract-plist[Include casks using the ExtractPlist livecheck strategy]' \ '(--formula)--extract-plist[Enable checking multiple casks with ExtractPlist strategy]' \
'--full-name[Print formulae and casks with fully-qualified names]' \ '--full-name[Print formulae and casks with fully-qualified names]' \
'--help[Show this message]' \ '--help[Show this message]' \
'(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \ '(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \
@ -1744,9 +1745,7 @@ _brew_tap() {
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'--eval-all[Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `HOMEBREW_EVAL_ALL` is set]' \ '--eval-all[Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `HOMEBREW_EVAL_ALL` is set]' \
'--force[Force install core taps even under API mode]' \ '--force[Force install core taps even under API mode]' \
'--force-auto-update[Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)]' \
'--help[Show this message]' \ '--help[Show this message]' \
'--no-force-auto-update[Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)]' \
'--quiet[Make some output more quiet]' \ '--quiet[Make some output more quiet]' \
'--repair[Migrate tapped formulae from symlink-based to directory-based structure]' \ '--repair[Migrate tapped formulae from symlink-based to directory-based structure]' \
'--verbose[Make some output more verbose]' \ '--verbose[Make some output more verbose]' \

View File

@ -442,6 +442,11 @@ message if no logs are found.
: The Gist will be marked private and will not appear in listings but will be : The Gist will be marked private and will not appear in listings but will be
accessible with its link. accessible with its link.
### `help` \[*`command`* ...\]
Outputs the usage instructions for `brew` *`command`*. Equivalent to `brew
--help` *`command`*.
### `home`, `homepage` \[`--formula`\] \[`--cask`\] \[*`formula`*\|*`cask`* ...\] ### `home`, `homepage` \[`--formula`\] \[`--cask`\] \[*`formula`*\|*`cask`* ...\]
Open a *`formula`* or *`cask`*'s homepage in a browser, or open Homebrew's own Open a *`formula`* or *`cask`*'s homepage in a browser, or open Homebrew's own
@ -1150,11 +1155,6 @@ simplifies but also limits. This two-argument command makes no assumptions, so
taps can be cloned from places other than GitHub and using protocols other than taps can be cloned from places other than GitHub and using protocols other than
HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync. HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
`--[no-]force-auto-update`
: Auto-update tap even if it is not hosted on GitHub. By default, only taps
hosted on GitHub are auto-updated (for performance reasons).
`--custom-remote` `--custom-remote`
: Install or change a tap with a custom remote. Useful for mirrors. : Install or change a tap with a custom remote. Useful for mirrors.
@ -2290,7 +2290,7 @@ from `HOMEBREW_LIVECHECK_WATCHLIST` or `~/.homebrew/livecheck_watchlist.txt`.
`--extract-plist` `--extract-plist`
: Include casks using the ExtractPlist livecheck strategy. : Enable checking multiple casks with ExtractPlist strategy.
### `pr-automerge` \[*`options`*\] ### `pr-automerge` \[*`options`*\]
@ -3267,6 +3267,10 @@ and Linux workers.
: Only test the direct dependents. : Only test the direct dependents.
`--skip-repository-audit`
: Don't audit the repository.
`--skip-checksum-only-audit` `--skip-checksum-only-audit`
: Don't audit checksum-only changes. : Don't audit checksum-only changes.

View File

@ -279,6 +279,8 @@ Automatically create a new issue in the appropriate GitHub repository after crea
.TP .TP
\fB\-p\fP, \fB\-\-private\fP \fB\-p\fP, \fB\-\-private\fP
The Gist will be marked private and will not appear in listings but will be accessible with its link\. The Gist will be marked private and will not appear in listings but will be accessible with its link\.
.SS "\fBhelp\fP \fR[\fIcommand\fP \.\.\.]"
Outputs the usage instructions for \fBbrew\fP \fIcommand\fP\&\. Equivalent to \fBbrew \-\-help\fP \fIcommand\fP\&\.
.SS "\fBhome\fP, \fBhomepage\fP \fR[\fB\-\-formula\fP] \fR[\fB\-\-cask\fP] \fR[\fIformula\fP|\fIcask\fP \.\.\.]" .SS "\fBhome\fP, \fBhomepage\fP \fR[\fB\-\-formula\fP] \fR[\fB\-\-cask\fP] \fR[\fIformula\fP|\fIcask\fP \.\.\.]"
Open a \fIformula\fP or \fIcask\fP\[u2019]s homepage in a browser, or open Homebrew\[u2019]s own homepage if no argument is provided\. Open a \fIformula\fP or \fIcask\fP\[u2019]s homepage in a browser, or open Homebrew\[u2019]s own homepage if no argument is provided\.
.TP .TP
@ -718,9 +720,6 @@ With \fIURL\fP unspecified, tap a formula repository from GitHub using HTTPS\. S
.P .P
With \fIURL\fP specified, tap a formula repository from anywhere, using any transport protocol that \fBgit\fP(1) handles\. The one\-argument form of \fBtap\fP simplifies but also limits\. This two\-argument command makes no assumptions, so taps can be cloned from places other than GitHub and using protocols other than HTTPS, e\.g\. SSH, git, HTTP, FTP(S), rsync\. With \fIURL\fP specified, tap a formula repository from anywhere, using any transport protocol that \fBgit\fP(1) handles\. The one\-argument form of \fBtap\fP simplifies but also limits\. This two\-argument command makes no assumptions, so taps can be cloned from places other than GitHub and using protocols other than HTTPS, e\.g\. SSH, git, HTTP, FTP(S), rsync\.
.TP .TP
\fB\-\-[no\-]force\-auto\-update\fP
Auto\-update tap even if it is not hosted on GitHub\. By default, only taps hosted on GitHub are auto\-updated (for performance reasons)\.
.TP
\fB\-\-custom\-remote\fP \fB\-\-custom\-remote\fP
Install or change a tap with a custom remote\. Useful for mirrors\. Install or change a tap with a custom remote\. Useful for mirrors\.
.TP .TP
@ -1455,7 +1454,7 @@ Only check formulae\.
Only check casks\. Only check casks\.
.TP .TP
\fB\-\-extract\-plist\fP \fB\-\-extract\-plist\fP
Include casks using the ExtractPlist livecheck strategy\. Enable checking multiple casks with ExtractPlist strategy\.
.SS "\fBpr\-automerge\fP \fR[\fIoptions\fP]" .SS "\fBpr\-automerge\fP \fR[\fIoptions\fP]"
Find pull requests that can be automatically merged using \fBbrew pr\-publish\fP\&\. Find pull requests that can be automatically merged using \fBbrew pr\-publish\fP\&\.
.TP .TP
@ -2087,6 +2086,9 @@ Don\[u2019]t test livecheck\.
\fB\-\-skip\-recursive\-dependents\fP \fB\-\-skip\-recursive\-dependents\fP
Only test the direct dependents\. Only test the direct dependents\.
.TP .TP
\fB\-\-skip\-repository\-audit\fP
Don\[u2019]t audit the repository\.
.TP
\fB\-\-skip\-checksum\-only\-audit\fP \fB\-\-skip\-checksum\-only\-audit\fP
Don\[u2019]t audit checksum\-only changes\. Don\[u2019]t audit checksum\-only changes\.
.TP .TP