cmd: indicate multiple named args in usage banner
This commit is contained in:
parent
bca4804a9e
commit
332372469f
@ -16,7 +16,7 @@ module Homebrew
|
||||
def __cache_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--cache` [<options>] [<formula>|<cask>]
|
||||
`--cache` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
|
||||
|
||||
|
@ -10,7 +10,7 @@ module Homebrew
|
||||
def __caskroom_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--caskroom` [<cask>]
|
||||
`--caskroom` [<cask>] [<cask> ...]
|
||||
|
||||
Display Homebrew's Caskroom path.
|
||||
|
||||
|
@ -9,7 +9,7 @@ module Homebrew
|
||||
def __cellar_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--cellar` [<formula>]
|
||||
`--cellar` [<formula>] [<formula> ...]
|
||||
|
||||
Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
|
||||
that directory doesn't exist, `$(brew --repository)/Cellar`.
|
||||
|
@ -15,7 +15,7 @@ module Homebrew
|
||||
def __env_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--env` [<options>] [<formula>]
|
||||
`--env` [<options>] [<formula>] [<formula> ...]
|
||||
|
||||
Summarise Homebrew's build environment as a plain list.
|
||||
|
||||
|
@ -12,7 +12,7 @@ module Homebrew
|
||||
def __prefix_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--prefix` [<formula>]
|
||||
`--prefix` [<formula>] [<formula> ...]
|
||||
|
||||
Display Homebrew's install path. *Default:*
|
||||
|
||||
|
@ -12,7 +12,7 @@ module Homebrew
|
||||
def __repository_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`--repository`, `--repo` [<user>`/`<repo>]
|
||||
`--repository`, `--repo` [<user>`/`<repo>] [<user>`/`<repo> ...]
|
||||
|
||||
Display where Homebrew's `.git` directory is located.
|
||||
|
||||
|
@ -14,7 +14,7 @@ module Homebrew
|
||||
Homebrew::CLI::Parser.new do
|
||||
days = Homebrew::EnvConfig::ENVS[:HOMEBREW_CLEANUP_MAX_AGE_DAYS][:default]
|
||||
usage_banner <<~EOS
|
||||
`cleanup` [<options>] [<formula>|<cask>]
|
||||
`cleanup` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
Remove stale lock files and outdated downloads for all formulae and casks,
|
||||
and remove old versions of installed formulae. If arguments are specified,
|
||||
|
@ -18,7 +18,7 @@ module Homebrew
|
||||
def deps_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`deps` [<options>] [<formula>]
|
||||
`deps` [<options>] [<formula>] [<formula> ...]
|
||||
|
||||
Show dependencies for <formula>. Additional options specific to <formula>
|
||||
may be appended to the command. When given multiple formula arguments,
|
||||
|
@ -17,7 +17,7 @@ module Homebrew
|
||||
def desc_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`desc` [<options>] (<text>|`/`<text>`/`|<formula>)
|
||||
`desc` [<options>] <text>|`/`<text>`/`|<formula> [<text>|`/`<text>`/`|<formula> ...]
|
||||
|
||||
Display <formula>'s name and one-line description.
|
||||
Formula descriptions are cached; the cache is created on the
|
||||
@ -35,7 +35,7 @@ module Homebrew
|
||||
|
||||
conflicts "--search", "--name", "--description"
|
||||
|
||||
named_args :formula
|
||||
named_args :formula, min: 1
|
||||
end
|
||||
end
|
||||
|
||||
@ -51,14 +51,10 @@ module Homebrew
|
||||
end
|
||||
|
||||
results = if search_type.nil?
|
||||
raise FormulaUnspecifiedError if args.no_named?
|
||||
|
||||
desc = {}
|
||||
args.named.to_formulae.each { |f| desc[f.full_name] = f.desc }
|
||||
Descriptions.new(desc)
|
||||
else
|
||||
raise UsageError, "this command requires a search term" if args.no_named?
|
||||
|
||||
query = args.named.join(" ")
|
||||
string_or_regex = query_regexp(query)
|
||||
CacheStoreDatabase.use(:descriptions) do |db|
|
||||
|
@ -17,7 +17,7 @@ module Homebrew
|
||||
def fetch_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`fetch` [<options>] <formula>
|
||||
`fetch` [<options>] <formula>|<cask> [<formula>|<cask> ...]
|
||||
|
||||
Download a bottle (if available) or source packages for <formula>e
|
||||
and binaries for <cask>s. For files, also print SHA-256 checksums.
|
||||
|
@ -13,7 +13,7 @@ module Homebrew
|
||||
def home_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`home` [<formula>|<cask>]
|
||||
`home` [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
Open a <formula> or <cask>'s homepage in a browser, or open
|
||||
Homebrew's own homepage if no argument is provided.
|
||||
|
@ -25,7 +25,7 @@ module Homebrew
|
||||
def info_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`info` [<options>] [<formula>|<cask>]
|
||||
`info` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
Display brief statistics for your Homebrew installation.
|
||||
|
||||
|
@ -24,7 +24,7 @@ module Homebrew
|
||||
def install_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`install` [<options>] <formula>|<cask>
|
||||
`install` [<options>] <formula>|<cask> [<formula>|<cask> ...]
|
||||
|
||||
Install a <formula> or <cask>. Additional options specific to a <formula> may be
|
||||
appended to the command.
|
||||
|
@ -15,7 +15,7 @@ module Homebrew
|
||||
def link_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`link`, `ln` [<options>] <formula>
|
||||
`link`, `ln` [<options>] <formula> [<formula> ...]
|
||||
|
||||
Symlink all of <formula>'s installed files into Homebrew's prefix. This
|
||||
is done automatically when you install formulae but can be useful for DIY
|
||||
|
@ -15,7 +15,7 @@ module Homebrew
|
||||
def list_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`list`, `ls` [<options>] [<formula>|<cask>]
|
||||
`list`, `ls` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
List all installed formulae and casks.
|
||||
|
||||
|
@ -13,7 +13,7 @@ module Homebrew
|
||||
def migrate_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`migrate` [<options>] <formula>
|
||||
`migrate` [<options>] <formula> [<formula> ...]
|
||||
|
||||
Migrate renamed packages to new names, where <formula> are old names of
|
||||
packages.
|
||||
|
@ -15,7 +15,7 @@ module Homebrew
|
||||
def missing_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`missing` [<options>] [<formula>]
|
||||
`missing` [<options>] [<formula>] [<formula> ...]
|
||||
|
||||
Check the given <formula> kegs for missing dependencies. If no <formula> are
|
||||
provided, check all kegs. Will exit with a non-zero status if any kegs are found
|
||||
|
@ -15,7 +15,7 @@ module Homebrew
|
||||
def options_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`options` [<options>] [<formula>]
|
||||
`options` [<options>] [<formula>] [<formula> ...]
|
||||
|
||||
Show install options specific to <formula>.
|
||||
EOS
|
||||
|
@ -16,7 +16,7 @@ module Homebrew
|
||||
def outdated_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`outdated` [<options>] [<formula>|<cask>]
|
||||
`outdated` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
List installed casks and formulae that have an updated version available. By default, version
|
||||
information is displayed in interactive shells, and suppressed otherwise.
|
||||
|
@ -13,7 +13,7 @@ module Homebrew
|
||||
def pin_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`pin` <formula>
|
||||
`pin` <formula> [<formula> ...]
|
||||
|
||||
Pin the specified <formula>, preventing them from being upgraded when
|
||||
issuing the `brew upgrade` <formula> command. See also `unpin`.
|
||||
|
@ -14,7 +14,7 @@ module Homebrew
|
||||
def postinstall_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`postinstall` <formula>
|
||||
`postinstall` <formula> [<formula> ...]
|
||||
|
||||
Rerun the post-install steps for <formula>.
|
||||
EOS
|
||||
|
@ -13,7 +13,7 @@ module Homebrew
|
||||
def readall_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`readall` [<options>] [<tap>]
|
||||
`readall` [<options>] [<tap>] [<tap> ...]
|
||||
|
||||
Import all items from the specified <tap>, or from all installed taps if none is provided.
|
||||
This can be useful for debugging issues across all items when making
|
||||
|
@ -22,7 +22,7 @@ module Homebrew
|
||||
def reinstall_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`reinstall` [<options>] <formula>|<cask>
|
||||
`reinstall` [<options>] <formula>|<cask> [<formula>|<cask> ...]
|
||||
|
||||
Uninstall and then reinstall a <formula> or <cask> using the same options it was
|
||||
originally installed with, plus any appended options specific to a <formula>.
|
||||
|
@ -31,7 +31,7 @@ module Homebrew
|
||||
def search_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`search` [<options>] [<text>|`/`<text>`/`]
|
||||
`search` [<options>] [<text>|`/`<text>`/`] [<text>|`/`<text>`/` ...]
|
||||
|
||||
Perform a substring search of cask tokens and formula names for <text>. If <text>
|
||||
is flanked by slashes, it is interpreted as a regular expression.
|
||||
|
@ -19,7 +19,7 @@ module Homebrew
|
||||
Symlink all of the specified <version> of <formula>'s installation into Homebrew's prefix.
|
||||
EOS
|
||||
|
||||
named 2
|
||||
named_args number: 2
|
||||
hide_from_man_page!
|
||||
end
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ module Homebrew
|
||||
def tap_info_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`tap-info` [<options>] [<tap>]
|
||||
`tap-info` [<options>] [<tap>] [<tap> ...]
|
||||
|
||||
Show detailed information about one or more <tap>s.
|
||||
|
||||
|
@ -19,7 +19,7 @@ module Homebrew
|
||||
def uninstall_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`uninstall`, `rm`, `remove` [<options>] <formula>|<cask>
|
||||
`uninstall`, `rm`, `remove` [<options>] <formula>|<cask> [<formula>|<cask> ...]
|
||||
|
||||
Uninstall a <formula> or <cask>.
|
||||
EOS
|
||||
|
@ -14,7 +14,7 @@ module Homebrew
|
||||
def unlink_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`unlink` [<options>] <formula>
|
||||
`unlink` [<options>] <formula> [<formula> ...]
|
||||
|
||||
Remove symlinks for <formula> from Homebrew's prefix. This can be useful
|
||||
for temporarily disabling a formula:
|
||||
|
@ -13,7 +13,7 @@ module Homebrew
|
||||
def unpin_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`unpin` <formula>
|
||||
`unpin` <formula> [<formula> ...]
|
||||
|
||||
Unpin <formula>, allowing them to be upgraded by `brew upgrade` <formula>.
|
||||
See also `pin`.
|
||||
|
@ -12,7 +12,7 @@ module Homebrew
|
||||
def untap_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`untap` <tap>
|
||||
`untap` <tap> [<tap> ...]
|
||||
|
||||
Remove a tapped formula repository.
|
||||
EOS
|
||||
|
@ -1,4 +1,4 @@
|
||||
#: * `update-reset` [<repository>]
|
||||
#: * `update-reset` [<repository>] [<repository> ...]
|
||||
#:
|
||||
#: Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/master`.
|
||||
#:
|
||||
|
@ -18,7 +18,7 @@ module Homebrew
|
||||
def upgrade_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`upgrade` [<options>] [<formula>|<cask>]
|
||||
`upgrade` [<options>] [<formula>|<cask>] [<formula>|<cask> ...]
|
||||
|
||||
Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally
|
||||
installed with, plus any appended brew formula options. If <cask> or <formula> are specified,
|
||||
|
@ -21,7 +21,7 @@ module Homebrew
|
||||
def uses_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`uses` [<options>] <formula>
|
||||
`uses` [<options>] <formula> [<formula> ...]
|
||||
|
||||
Show formulae and casks that specify <formula> as a dependency (i.e. show dependents
|
||||
of <formula>). When given multiple formula arguments, show the intersection
|
||||
|
Loading…
x
Reference in New Issue
Block a user