public function Command::addOption in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Command/Command.php \Symfony\Component\Console\Command\Command::addOption()
Adds an option.
Parameters
string $name The option name:
string $shortcut The shortcut (can be null):
int $mode The option mode: One of the InputOption::VALUE_* constants:
string $description A description text:
mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE):
Return value
Command The current instance
File
- vendor/
symfony/ console/ Command/ Command.php, line 387
Class
- Command
- Base class for all commands.
Namespace
Symfony\Component\Console\CommandCode
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) {
$this->definition
->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
return $this;
}