class Bard::CLI::Command
Public Class Methods
Source
# File lib/bard/cli/command.rb, line 4 def self.desc command, description @command = command @method = command.split(" ").first.to_sym @description = description end
Source
# File lib/bard/cli/command.rb, line 10 def self.option *args, **kwargs @option_args = args @option_kwargs = kwargs end
Source
# File lib/bard/cli/command.rb, line 15 def self.setup cli cli.desc @command, @description cli.option *@option_args, **@option_kwargs if @option_args || @option_kwargs # put in local variables so next block can capture it command_class = self method = @method cli.define_method method do |*args| command = command_class.new(self) command.send method, *args end end