Add missing help methods for external cask commands.

This commit is contained in:
Markus Reiter 2020-08-13 22:24:40 +02:00
parent 7bc9b3f2b7
commit 60c4e22eb0

View File

@ -230,15 +230,25 @@ module Cask
end
def run(*args)
command_class&.run(*args)
end
def help
command_class&.help
end
private
def command_class
return @command_class if defined?(@command_class)
require @path
klass = begin
@command_class = begin
Cmd.const_get(@command_name)
rescue NameError
return
nil
end
klass.run(*args)
end
end
@ -250,6 +260,10 @@ module Cask
def run(*argv)
exec @path, *argv
end
def help
exec @path, "--help"
end
end
class UnknownSubcommand