29 lines
507 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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
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
2019-08-06 14:20:27 -04:00
Display the path where <formula> is located.
2018-09-28 21:39:52 +05:30
EOS
switch :verbose
switch :debug
end
end
def formula
formula_args.parse
raise FormulaUnspecifiedError if Homebrew.args.named.blank?
2018-09-17 02:45:00 +02:00
Homebrew.args.resolved_formulae.each { |f| puts f.path }
2017-02-07 23:25:02 -08:00
end
end