Method | Description | |
---|---|---|
__construct ( array | Traversable $spec = null ) | Compile the original spec | |
__get ( $o ) | ||
__isset ( $o ) | ||
__set ( $o, $v ) | ||
__unset ( $o ) | ||
compile ( array | Traversable $spec ) : pharext\Cli\Args | Compile the original spec | |
getCompiledSpec ( ) : array | Get compiled spec | |
getSpec ( ) : array | Get original spec | |
offsetExists ( $o ) | ||
offsetGet ( $o ) | ||
offsetSet ( $o, $v ) | ||
offsetUnset ( $o ) | ||
parse ( integer $argc, array $argv ) : Generator | Parse command line arguments according to the compiled spec. | |
toArray ( ) | ||
validate ( ) : Generator | Validate that all required options were given. |
Method | Description | |
---|---|---|
opt ( string $o ) : string | Retreive the canonical name (--long-name) of an option | |
optAcceptsArg ( string $o ) : boolean | Check wether an option accepts any argument | |
optDefaultArg ( string $o ) : mixed | Retreive the default argument of an option | |
optFlags ( string $o ) : integer | Retrieve option's flags | |
optHalts ( string $o ) : boolean | Check whether an option is flagged for halting argument processing | |
optHelp ( string $o ) : string | Retrieve the help message of an option | |
optIsMulti ( string $o ) : boolean | Check whether an option can be used more than once | |
optLongName ( string $o ) : string | Retreive the long name of an option | |
optRequiresArg ( string $o ) : boolean | Check whether an option needs an argument | |
optShortName ( string $o ) : string | Retreive the short name of an option |
public __construct ( array | Traversable $spec = null ) | ||
$spec | array | Traversable |
public compile ( array | Traversable $spec ) : pharext\Cli\Args | ||
$spec | array | Traversable | |
return | pharext\Cli\Args | self |