class DTK::Client::CLI::Command::Subcommand
Public Class Methods
new(gli_command)
click to toggle source
# File lib/cli/command/subcommand.rb, line 21 def initialize(gli_command) @gli_command = gli_command end
Public Instance Methods
action(*args, &body)
click to toggle source
# File lib/cli/command/subcommand.rb, line 33 def action(*args, &body) @gli_command.send(:action, *args) do |global_options, options, args| body.call(global_options, Options.new(options), args) end end
arg(*args)
click to toggle source
# File lib/cli/command/subcommand.rb, line 47 def arg(*args) Token::Arg.ret(@gli_command, *args) end
flag(*args)
click to toggle source
# File lib/cli/command/subcommand.rb, line 39 def flag(*args) Token::Flag.ret(@gli_command, *args) end
method_missing(method, *args, &body)
click to toggle source
# File lib/cli/command/subcommand.rb, line 25 def method_missing(method, *args, &body) @gli_command.send(method, *args, &body) end
respond_to?(method)
click to toggle source
# File lib/cli/command/subcommand.rb, line 29 def respond_to?(method) @gli_command.send(:respond_to?, method) end
switch(*args)
click to toggle source
# File lib/cli/command/subcommand.rb, line 43 def switch(*args) Token::Switch.ret(@gli_command, *args) end