brew/Library/Homebrew/cmd/--cellar.rb
EricFromCanada 560ccddb69 help: rewrap output to 80 columns
Accounts for paragraph breaks and option descriptions. Also fixes some help text nits.
2019-03-11 12:52:07 -04:00

30 lines
683 B
Ruby

require "cli_parser"
module Homebrew
module_function
def __cellar_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`--cellar` [<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
__cellar_args.parse
if ARGV.named.empty?
puts HOMEBREW_CELLAR
else
puts ARGV.resolved_formulae.map(&:rack)
end
end
end