command: handle multiple named args

This commit is contained in:
EricFromCanada 2019-12-13 16:57:57 -05:00
parent 90e830c19e
commit 0c8eae8d9c

View File

@ -23,7 +23,8 @@ module Homebrew
raise UsageError, "This command requires a command argument" if args.remaining.empty?
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(args.remaining.first, args.remaining.first)
args.remaining.each do |c|
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(c, c)
path = Commands.path(cmd)
cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path
path ||= which("brew-#{cmd}", cmd_paths)
@ -33,3 +34,4 @@ module Homebrew
puts path
end
end
end