Property | Type | Description | |
---|---|---|---|
$methods | Valid "option" options, mapped to their aliases |
Method | Description | |
---|---|---|
__call ( string $name, array $arguments ) : |
This is the meat of Command. Any time we are operating on an individual option for command (e.g. $cmd->option()->require(). | |
__construct ( array | null $tokens = null ) | ||
__destruct ( ) | ||
__toString ( ) : string | ||
beepOnError ( boolean $beep = true ) : |
Terminal beep on error | |
current ( ) : mixed | ||
define ( array $tokens = null ) : |
Factory style reads a little nicer | |
doNotTrapErrors ( ) : |
||
error ( Exception $e ) | ||
getArgumentValues ( ) : array | ||
getArguments ( ) : array | ||
getFlagValues ( ) : array | ||
getFlags ( ) : array | ||
getHelp ( ) : string | ||
getOption ( string $option ) : |
||
getOptions ( ) : array | ||
getSize ( ) : integer | ||
hasOption ( string $option ) : boolean | ||
isParsed ( ) : boolean | Has this Command instance parsed its arguments? | |
key ( ) : integer | ||
next ( ) | ||
offsetExists ( string $offset ) : boolean | ||
offsetGet ( string $offset ) : mixed | ||
offsetSet ( string $offset, string $value ) | ||
offsetUnset ( string $offset ) | ||
parse ( ) : void | ||
printHelp ( ) | ||
rewind ( ) | ||
setHelp ( string $help ) : |
||
setTokens ( array $cli_tokens ) : |
Rare that you would need to use this other than for testing, allows defining the cli tokens, instead of using $argv | |
trapErrors ( boolean $trap = true ) : |
||
useDefaultHelp ( boolean $help = true ) | ||
valid ( ) : boolean |
Method | Description | |
---|---|---|
_alias ( |
||
_argument ( |
||
_boolean ( |
||
_default ( |
||
_describe ( |
||
_file ( |
||
_flag ( |
||
_increment ( |
||
_map ( |
||
_must ( |
||
_needs ( |
Set a requirement on an option | |
_option ( |
||
_parseOption ( string $token ) : array | ||
_require ( |
||
_title ( |
||
attachHelp ( ) | ||
dedupeFlags ( ) : array | ||
parseIfNotParsed ( ) : void |
public beepOnError ( boolean $beep = true ) : |
||
$beep | boolean | |
return |
public getArgumentValues ( ) : array | ||
return | array | of argument values only If your command was `php filename -f flagvalue argument1 argument2` `getArguments` would return array("argument1", "argument2"); |
public getFlagValues ( ) : array | ||
return | array | of flag values only If your command was `php filename -f flagvalue argument1 argument2` `getFlags` would return array("-f" => "flagvalue"); |
public offsetExists ( string $offset ) : boolean | ||
$offset | string | |
return | boolean |
public trapErrors ( boolean $trap = true ) : |
||
$trap | boolean | when true, exceptions will be caught by Commando and printed cleanly to standard error. |
return |