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? 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) path = Commands.path(cmd)
cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path
path ||= which("brew-#{cmd}", cmd_paths) path ||= which("brew-#{cmd}", cmd_paths)
@ -32,4 +33,5 @@ module Homebrew
odie "Unknown command: #{cmd}" unless path odie "Unknown command: #{cmd}" unless path
puts path puts path
end end
end
end end