Fix brew cask <command> --help.
This commit is contained in:
parent
6d9a20614a
commit
7f400d8e4e
@ -145,7 +145,7 @@ module Cask
|
||||
command, args = detect_internal_command(*args) || detect_external_command(*args) || [NullCommand.new, args]
|
||||
|
||||
if help?
|
||||
puts command.help
|
||||
Help.new(command.command_name).run
|
||||
else
|
||||
command.run(*args)
|
||||
end
|
||||
|
||||
@ -11,12 +11,15 @@ module Cask
|
||||
elsif args.count == 1
|
||||
command_name = args.first
|
||||
|
||||
if (command = self.class.commands[command_name]) && command.respond_to?(:usage)
|
||||
puts command.usage
|
||||
return
|
||||
unless command = self.class.commands[command_name]
|
||||
raise "No help information found for command '#{command_name}'."
|
||||
end
|
||||
|
||||
raise "No help information found for command '#{command_name}'."
|
||||
if command.respond_to?(:usage)
|
||||
puts command.usage
|
||||
else
|
||||
puts command.help
|
||||
end
|
||||
else
|
||||
raise ArgumentError, "#{self.class.command_name} only takes up to one argument."
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user