Constants

HELP_OPTION

HELP_OPTION

HELP_SHORTOPTION

HELP_SHORTOPTION

Methods

__construct()

__construct()

Constructors Defines available colors

getColoredString()

getColoredString( $string, null $foreground_color, null $background_color) : string

Returns colored string

Parameters

$string
null $foreground_color
null $background_color

Returns

string

getForegroundColors()

getForegroundColors() : array

Returns all foreground color names

Returns

array

getBackgroundColors()

getBackgroundColors() : array

Returns all background color names

Returns

array

setOptions()

setOptions() : mixed

Task's available options

Returns

mixed

beforeExecuteRoute()

beforeExecuteRoute() : boolean

Sets available actions with options Validates command line arguments and options for command Stops dispatching when detects help option

Returns

boolean

mainAction()

mainAction()

Action executed by default when no action was specified in execution

getOutput()

getOutput() : string

Returns collected output

Returns

string

putText()

putText( $str)

Puts text into buffer

Parameters

$str

putWarn()

putWarn( $str)

Puts warning into buffer

Parameters

$str

putSuccess()

putSuccess( $str)

Puts success into buffer

Parameters

$str

putError()

putError( $str)

Puts error into buffer

Parameters

$str

Throws

\Exception

pubObject()

pubObject( $object)

Dumps object into buffer

Parameters

$object

getArgs()

getArgs() : array

Returns array of execution arguments

Returns

array

getArg()

getArg( $index) : null

Return argument from indicated index

Parameters

$index

Returns

null

getOption()

getOption( $name, null $default) : mixed

Get option value for action from command line

Parameters

$name
null $default

Throws

\Vegas\Cli\Task\Exception\MissingArgumentException

Returns

mixed

addTaskAction()

addTaskAction(\Vegas\Cli\Task\Action $action) : $this

Adds available action for current Task

Parameters

\Vegas\Cli\Task\Action $action

Returns

$this

renderActionHelp()

renderActionHelp()

Renders help for task action

renderTaskHelp()

renderTaskHelp()

Renders help for task

validate()

validate()

Validates action options