Property | Type | Description | |
---|---|---|---|
$debug | array | ||
$errors | validation errors | ||
$isHelpRequest | The user wants help info | ||
$moreArgs | array | ||
$values | option values available after validation. E.g. array( 'a' => false // option was missing ,'b' => true // option was present ,'c' => "Hello" // option had value ,'f' => "/home/user/file" // file path from root ,'f.raw' => "~/file" // file path as given to option ) |
Property | Type | Description | |
---|---|---|---|
$_args | |||
$_stdin | resource | ||
$_stdout | resource |
Method | Description | |
---|---|---|
__construct ( boolean $exitIfNoStdin = true ) | ||
addArgument ( string $letter, boolean $required, |
||
addOptionalArg ( |
||
addRequiredArg ( |
||
closeInput ( ) | ||
closeOutput ( ) | ||
getArgument ( string $letter ) : |
||
getArgumentsListing ( ) : string | ||
getErrorReport ( ) : string | Get a short list of errors with options | |
getPathArgs ( ) : array | Get the full paths of file(s) passed in as unspecified arguments | |
openInput ( ) : resource | Get resource of open input stream. May be STDIN or a file pointer to the file specified by an option with 'STDIN'. | |
openOutput ( ) : resource | Get resource of open output stream. May be STDOUT or a file pointer to the file specified by an option with 'STDOUT'. The file will be truncated to 0 bytes on opening. | |
validate ( ) | * Read and validate options |
Method | Description | |
---|---|---|
addError ( string $letter, string $msg, string $value = null ) |
public __construct ( boolean $exitIfNoStdin = true ) | ||
$exitIfNoStdin | boolean | (default true) Exit() if STDIN is not defined |
public addArgument ( string $letter, boolean $required, |
||
$letter | string | |
$required | boolean | |
$arg | ||
return |
public addOptionalArg ( |
||
$letter | ||
return |
public addRequiredArg ( |
||
$letter | ||
return |
public getArgument ( string $letter ) : |
||
$letter | string | |
return |
public getErrorReport ( ) : string | ||
return | string |
public getPathArgs ( ) : array | ||
return | array |
public openInput ( ) : resource | ||
return | resource |
public openOutput ( ) : resource | ||
return | resource |
public $values |