$action = 'StoreString'
[line 68]
The option action, defaults to StoreString.
$action_params = array()
[line 133]
An associative array of additional params to pass to the class corresponding to the action, this array will also be passed to the callback defined for an action of type Callback, Example:
// for a custom action
$parser->addOption('myoption', array(
'short_name' => '-m',
'long_name' => '--myoption',
'action' => 'MyCustomAction',
'action_params' => array('foo'=>true, 'bar'=>false)
));
// if the user type:
// $ <yourprogram> -m spam
// in your MyCustomAction class the execute() method will be called
// with the value 'spam' as first parameter and
// array('foo'=>true, 'bar'=>false) as second parameter
$argument_optional = false
[line 142]
For options that expect an argument, this property tells the parser if the argument is optional and can be ommited
$callback =
[line 107]
The callback function (or method) to call for an action of type Callback, this can be any callable supported by the php function call_user_func.
Example:
$parser->addOption('myoption', array(
'short_name' => '-m',
'long_name' => '--myoption',
'action' => 'Callback',
'callback' => 'myCallbackFunction'
));
$choices = array()
[line 86]
An array of possible values for the option if this array is not empty and the value passed is not in the array an exception is raised.
This only make sense for actions that accept values of course.
$default =
[line 76]
The default value of the option if not provided on the command line.
$long_name =
[line 60]
The option long name (ex: --verbose).
$short_name =
[line 52]
The option short name (ex: -v).