interface PreflightArgsInterface (View source)

Storage for arguments preprocessed during preflight.

Methods

optionsWithValues()

Return an associative array of '--option' => 'methodName'.

applyToConfig(ConfigInterface $config)

Copy any applicable arguments into the provided configuration object, as appropriate.

args()

Return all of the args from the inputs that were NOT processed by the ArgsPreprocessor (anything not listed in optionsWithValues).

applicationPath()

Return the path to this application's executable ($argv[0]).

commandName()

Return the command name from the runtime args. Note that the command name also exists inside the runtime args, because the runtime args maintain the order of the options relative to the command name (save for those options removed by preflight args).

setCommandName($commandName)

Store the command name, once it is found.

addArg(string $arg)

Add one argument to the end of the list returned by the args() method.

passArgs($args)

Add everything in the provided array to the list returned by args()

alias()

Return any '@alias' that may have appeared before the argument holding the command name.

hasAlias()

Returns 'true' if an '@alias' was set.

setAlias(string $alias)

Set an alias. Should always begin with '@'.

Details

optionsWithValues()

Return an associative array of '--option' => 'methodName'.

The 'option' string should begin with the appropriate number of dashes (one or two, as desired), and should end with a '=' if the option requires a value.

applyToConfig(ConfigInterface $config)

Copy any applicable arguments into the provided configuration object, as appropriate.

Parameters

ConfigInterface $config The configuration object to inject data into

args()

Return all of the args from the inputs that were NOT processed by the ArgsPreprocessor (anything not listed in optionsWithValues).

applicationPath()

Return the path to this application's executable ($argv[0]).

commandName()

Return the command name from the runtime args. Note that the command name also exists inside the runtime args, because the runtime args maintain the order of the options relative to the command name (save for those options removed by preflight args).

setCommandName($commandName)

Store the command name, once it is found.

Parameters

$commandName

addArg(string $arg)

Add one argument to the end of the list returned by the args() method.

Parameters

string $arg One argument

passArgs($args)

Add everything in the provided array to the list returned by args()

Parameters

$args

alias()

Return any '@alias' that may have appeared before the argument holding the command name.

hasAlias()

Returns 'true' if an '@alias' was set.

setAlias(string $alias)

Set an alias. Should always begin with '@'.

Parameters

string $alias The alias name '@site'