2017-02-07 23:25:02 -08:00
|
|
|
require "formula"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2017-02-07 23:25:02 -08:00
|
|
|
|
|
|
|
module Homebrew
|
|
|
|
module_function
|
|
|
|
|
2018-07-30 18:25:38 +05:30
|
|
|
def formula_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
2018-09-28 21:39:52 +05:30
|
|
|
usage_banner <<~EOS
|
2019-01-30 21:33:03 +00:00
|
|
|
`formula` <formula>
|
2018-09-28 21:39:52 +05:30
|
|
|
|
2018-10-08 22:49:03 -04:00
|
|
|
Display the path where a formula is located.
|
2018-09-28 21:39:52 +05:30
|
|
|
EOS
|
2018-04-01 16:47:30 +05:30
|
|
|
switch :verbose
|
2018-10-08 22:49:03 -04:00
|
|
|
switch :debug
|
2018-04-01 16:47:30 +05:30
|
|
|
end
|
2018-07-30 18:25:38 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def formula
|
|
|
|
formula_args.parse
|
2018-04-01 16:47:30 +05:30
|
|
|
|
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
|