class CLI::Input
Slightly easifications for the setup of an OptionParser, used
by subcommands
Attributes
app_name[R]
Application name (String)
command_name[R]
Command name (String)
Public Instance Methods
CLI::Input#add_help() → CLI::Input
click to toggle source
Adding --help option is easy
# File lib/cli/input.rb, line 40 def add_help self.on('-h', '--help', 'Display this screen') do $stdout.puts self exit 0 end return self end
CLI::Input#from_command(Command command) → CLI::Input
click to toggle source
Set app_name, command_name and
program_name from Command command
# File lib/cli/input.rb, line 16 def from_command(command) @app_name = command.app_name @command_name = command.command_name @program_name = '%s %s' % [@app_name, @command_name] return self end