27 lines
458 B
Ruby
Raw Normal View History

2017-02-07 23:25:02 -08:00
require "formula"
require "cli_parser"
2017-02-07 23:25:02 -08:00
module Homebrew
module_function
def formula_args
Homebrew::CLI::Parser.new do
2018-09-28 21:39:52 +05:30
usage_banner <<~EOS
`formula` <formula>
2018-09-28 21:39:52 +05:30
Display the path where a formula is located.
2018-09-28 21:39:52 +05:30
EOS
switch :verbose
switch :debug
end
end
def formula
formula_args.parse
2017-02-07 23:25:02 -08:00
raise FormulaUnspecifiedError if ARGV.named.empty?
2018-09-17 02:45:00 +02:00
2017-02-11 16:37:41 -08:00
ARGV.resolved_formulae.each { |f| puts f.path }
2017-02-07 23:25:02 -08:00
end
end