--cellar: use CLI::Parser.
This commit is contained in:
parent
8fca70e76b
commit
93799ba71a
@ -1,15 +1,25 @@
|
|||||||
#: * `--cellar`:
|
require "cli_parser"
|
||||||
#: Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
|
|
||||||
#: that directory doesn't exist, `$(brew --repository)/Cellar`.
|
|
||||||
#:
|
|
||||||
#: * `--cellar` <formula>:
|
|
||||||
#: Display the location in the cellar where <formula> would be installed,
|
|
||||||
#: without any sort of versioned directory as the last path.
|
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
def __cellar_args
|
||||||
|
Homebrew::CLI::Parser.new do
|
||||||
|
usage_banner <<~EOS
|
||||||
|
`--cache` [<formula>]
|
||||||
|
|
||||||
|
Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
|
||||||
|
that directory doesn't exist, `$(brew --repository)/Cellar`.
|
||||||
|
|
||||||
|
If <formula> is provided, display the location in the cellar where <formula>
|
||||||
|
would be installed, without any sort of versioned directory as the last path.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def __cellar
|
def __cellar
|
||||||
|
__cellar_args.parse
|
||||||
|
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
puts HOMEBREW_CELLAR
|
puts HOMEBREW_CELLAR
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user