Class | CmdParse::Command |
In: |
lib/cmdparse.rb
|
Parent: | Object |
Base class for the commands. This class implements all needed methods so that it can be used by the CommandParser class.
commands | [R] | Returns the list of commands for this command. |
default_command | [R] | Returns the name of the default command. |
description | [RW] | A detailed description of the command |
name | [R] | The name of the command |
options | [RW] | The wrapper for parsing the command line options. |
short_desc | [RW] | A short description of the command. |
super_command | [RW] | Sets or returns the super command of this command. The super command is either a Command instance for normal commands or a CommandParser instance for the root command. |
Initializes the command called name. The parameter has_commands specifies if this command takes other commands as argument. The optional argument partial_commands specifies, if partial command matching should be used.
Adds a command to the command list if this command takes other commands as argument. If the optional parameter default is true, then this command is used when no command is specified on the command line.
Returns the CommandParser instance for this command or nil if this command was not assigned to a CommandParser instance.
Invokes the block set by set_execution_block. This method is called by the CommandParser instance if this command was specified on the command line.