Interface RawArgs
The unparsed console arguments.
Implementations of this class represent the arguments that a user passes when calling the console. For example:
$ console server add --port 80 localhost
In this case, the raw arguments contain the tokens: * "server" * "add" * "--port" * "80" * "localhost"
With an implementation of Webmozart\Console\Api\Args\ArgsParser
and a configured
ArgsFormat, the Webmozart\Console\Api\Args\RawArgs
instance can be converted into an
Webmozart\Console\Api\Args\Args
instance:
$format = ArgsFormat::build() ->addCommandName(new CommandName('server')) ->addCommandName(new CommandName('add')) ->addOption(new Option('port', 'p', Option::VALUE_REQUIRED | Option::INTEGER)) ->addArgument(new Argument('host', Argument::REQUIRED)) ->getFormat(); $args = $parser->parseArgs($rawArgs, $format);
The Webmozart\Console\Api\Args\Args
instance can be used to access the options and arguments of
a command in a convenient way.
Namespace: Webmozart\Console\Api\Args
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
See:
Located at Api/Args/RawArgs.php
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
See:
Webmozart\Console\Api\Args\Args
, ArgsFormat, Webmozart\Console\Api\Args\ArgsParser
Located at Api/Args/RawArgs.php
public
string|null
|
|
public
string[]
|
|
public
boolean
|
|
public
string
|