This class is used to build a command-line interface
Each command is represented by a subclass of this class, which may be nested to create more granular commands.
Following is an overview of the types of commands and what they should do.
Command.summary
to a brief description of the command.Command.options
to return the options it handles and their
descriptions and prepending them to the results of calling super
.Command#initialize
if it handles any parameters.Command#validate!
to check if the required parameters the
command handles are valid, or call Command#help!
in case they’re not.The following is needed for an abstract command:
Command.abstract_command
to true
.When the optional Command.description
is specified, it will be shown at
the top of the command’s help banner.
The following is needed for a normal command:
Command.arguments
to the description of the arguments this command
handles.Command#run
to perform the actual work.When the optional Command.description
is specified, it will be shown
underneath the usage section of the command’s help banner. Otherwise this
defaults to Command.summary
.
Object