mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
31 lines
488 B
Ruby
31 lines
488 B
Ruby
# typed: true
|
|
# frozen_string_literal: true
|
|
|
|
require "formula"
|
|
require "cli/parser"
|
|
|
|
module Homebrew
|
|
extend T::Sig
|
|
|
|
module_function
|
|
|
|
sig { returns(CLI::Parser) }
|
|
def formula_args
|
|
Homebrew::CLI::Parser.new do
|
|
usage_banner <<~EOS
|
|
`formula` <formula>
|
|
|
|
Display the path where <formula> is located.
|
|
EOS
|
|
|
|
min_named :formula
|
|
end
|
|
end
|
|
|
|
def formula
|
|
args = formula_args.parse
|
|
|
|
args.named.to_formulae_paths.each(&method(:puts))
|
|
end
|
|
end
|