Method | Description | |
---|---|---|
getConfig ( ) : array | Get command config array | |
getOutputter ( ) : Console_CommandLine_Outputter | Get CLI outputter | |
getParseResult ( ) : Console_CommandLine_Result | Get parsed result object | |
out ( string $str ) : Phrozn\Runner\CommandLine\Callback | Output string to stdout (flushes output). Wrapper around Outputter | |
readLine ( ) : string | Read-line either from STDIN or mock unit test data | |
setConfig ( array $config ) : Phrozn\Runner\CommandLine\Callback | Set config data for a given callback | |
setOutputter ( $out ) : Phrozn\Runner\CommandLine\Callback | Set CLI outputter | |
setParseResult ( Console_CommandLine_Result $result ) : Phrozn\Runner\CommandLine\Callback | Result object of CLI input parsing | |
setUnitTestData ( $data ) : Phrozn\Runner\CommandLine\Callback | Since Unit Testing readline can be tricky, confirm answer is exposed to unit test via this method. Simply pass the string you want to be used in place of readline() result. |
Method | Description | |
---|---|---|
combine ( string $file, boolean $verbose = false ) : string | Combine command documentation | |
getFooter ( ) : string | Phrozn CLI footer | |
getHeader ( ) : string | Phrozn CLI header | |
getPathArgument ( string $name, boolean $realpath = true, Console_CommandLine_Result $command = null ) : string | Extract path argument or fallback to cwd | |
isAbsolute ( string $path ) : boolean | See whether given path is absolute or relative | |
pad ( $str ) | ||
pre ( array $arr ) : string | Prepend all lines in array with intendation |
Method | Description | |
---|---|---|
getCommandMeta ( ) | ||
getRealCommandName ( string $file ) : string | Search if an alias exists for this command | |
useAnsiColors ( ) |
public getOutputter ( ) : Console_CommandLine_Outputter | ||
return | Console_CommandLine_Outputter | CLI outputter instance |
public getParseResult ( ) : Console_CommandLine_Result | ||
return | Console_CommandLine_Result |
protected isAbsolute ( string $path ) : boolean | ||
$path | string | Path to check |
return | boolean |
public setOutputter ( $out ) : Phrozn\Runner\CommandLine\Callback | ||
return | Phrozn\Runner\CommandLine\Callback |
public setParseResult ( Console_CommandLine_Result $result ) : Phrozn\Runner\CommandLine\Callback | ||
$result | Console_CommandLine_Result | Parser's result |
return | Phrozn\Runner\CommandLine\Callback |
public setUnitTestData ( $data ) : Phrozn\Runner\CommandLine\Callback | ||
return | Phrozn\Runner\CommandLine\Callback |