Class | Mercenary::Command |
In: |
lib/mercenary/command.rb
|
Parent: | Object |
actions | [RW] | |
aliases | [R] | |
commands | [RW] | |
description | [R] | |
map | [R] | |
name | [R] | |
options | [RW] | |
parent | [RW] | |
syntax | [R] | |
trace | [R] |
name - the name of the command parent - (optional) the instancce of Mercenary::Command which you wish to
be the parent of this command
Returns nothing
Public: Add an action Proc to be executed at runtime
block - the Proc to be executed at runtime
Returns nothing
Public: Adds a subcommand
cmd_name - the name of the command block - a block accepting the new instance of Mercenary::Command to be
modified (optional)
Returns nothing
Public: Sets or gets the command description
description - the description of what the command does (optional)
Returns the description and sets it if an argument is present
Public: Execute all actions given the inputted args and options
argv - (optional) command-line args (sans opts) config - (optional) the Hash configuration of string key to value
Returns nothing
Public: Fetch a Logger (stdlib)
level - the logger level (a Logger constant, see docs for more info)
Returns the instance of Logger
Public: Return all the names and aliases for this command.
Returns a comma-separated String list of the name followed by its aliases
Public: Adds an option switch
sym - the variable key which is used to identify the value of the switch
at runtime in the options hash
Returns nothing