Skip to content
Snippets Groups Projects
Commit 0c8eae8d authored by EricFromCanada's avatar EricFromCanada
Browse files

command: handle multiple named args

parent 90e830c1
No related branches found
No related tags found
No related merge requests found
...@@ -23,13 +23,15 @@ module Homebrew ...@@ -23,13 +23,15 @@ 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|
path = Commands.path(cmd) cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(c, c)
cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path path = Commands.path(cmd)
path ||= which("brew-#{cmd}", cmd_paths) cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path
path ||= which("brew-#{cmd}.rb", cmd_paths) path ||= which("brew-#{cmd}", cmd_paths)
path ||= which("brew-#{cmd}.rb", cmd_paths)
odie "Unknown command: #{cmd}" unless path
puts path odie "Unknown command: #{cmd}" unless path
puts path
end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment