$action = 'StoreString'
[line 66]
The option action, defaults to "StoreString".
$action_params = array()
[line 120]
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
$add_list_option = false
[line 137]
For options that uses the "choice" property only.
Adds a --list-<choice> option to the parser that displays the list of choices for the option.
$argument_optional = false
[line 128]
For options that expect an argument, this property tells the parser if the option argument is optional and can be ommited.
$callback =
[line 95]
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 75]
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.
$long_name =
[line 59]
The option long name (ex: --verbose).
$short_name =
[line 52]
The option short name (ex: -v).