You are here

private function ArrayInput::addShortOption in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Input/ArrayInput.php \Symfony\Component\Console\Input\ArrayInput::addShortOption()

Adds a short option value.

Parameters

string $shortcut The short option key:

mixed $value The value for the option:

Throws

\InvalidArgumentException When option given doesn't exist

1 call to ArrayInput::addShortOption()
ArrayInput::parse in vendor/symfony/console/Input/ArrayInput.php
Processes command line arguments.

File

vendor/symfony/console/Input/ArrayInput.php, line 154

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

private function addShortOption($shortcut, $value) {
  if (!$this->definition
    ->hasShortcut($shortcut)) {
    throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
  }
  $this
    ->addLongOption($this->definition
    ->getOptionForShortcut($shortcut)
    ->getName(), $value);
}