32 lines
534 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2016-09-07 20:09:22 +01:00
require "commands"
2019-04-17 18:25:08 +09:00
require "cli/parser"
2016-09-07 20:09:22 +01:00
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
2019-01-20 20:08:14 +05:30
def command_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`command` <cmd>
Display the path to the file being used when invoking `brew` <cmd>.
2019-01-20 20:08:14 +05:30
EOS
2020-07-30 18:40:10 +02:00
min_named 1
2019-01-20 20:08:14 +05:30
end
end
def command
2020-07-30 18:40:10 +02:00
args = command_args.parse
args.named.each do |cmd|
2019-12-13 16:57:57 -05:00
path = Commands.path(cmd)
odie "Unknown command: #{cmd}" unless path
puts path
end
end
end