command: handle multiple named args
This commit is contained in:
parent
90e830c19e
commit
0c8eae8d9c
@ -23,13 +23,15 @@ 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)
|
||||
path = Commands.path(cmd)
|
||||
cmd_paths = PATH.new(ENV["PATH"]).append(Tap.cmd_directories) unless path
|
||||
path ||= which("brew-#{cmd}", cmd_paths)
|
||||
path ||= which("brew-#{cmd}.rb", cmd_paths)
|
||||
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)
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user