Class | CmdParse::CommandParser |
In: |
lib/cmdparse.rb
|
Parent: | Object |
The main class for creating a command based CLI program.
banner | [RW] | A standard banner for help & version screens |
handle_exceptions | [R] | Are Exceptions be handled gracefully? I.e. by printing error message and the help screen? |
main_command | [R] | The top level command representing the program itself. |
program_name | [RW] | The name of the program. |
program_version | [RW] | The version of the program. |
Create a new CommandParser object. The optional argument handleExceptions specifies if the object should handle exceptions gracefully. Set partial_commands to true, if you want partial command matching for the top level commands.
Parses the command line arguments. If a block is specified, the current hierarchy level and the name of the current command is yielded after the options for the level have been parsed.