Merge pull request #8336 from reitermarkus/external-command-help

Add missing `help` methods for external `cask` commands.
This commit is contained in:
Markus Reiter 2020-08-13 23:14:48 +02:00 committed by GitHub
commit 9fa67ba354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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