You are here

private function ArgvInput::addShortOption in Zircon Profile 8

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

Adds a short option value.

Parameters

string $shortcut The short option key:

mixed $value The value for the option:

Throws

\RuntimeException When option given doesn't exist

1 call to ArgvInput::addShortOption()
ArgvInput::parseShortOption in vendor/symfony/console/Input/ArgvInput.php
Parses a short option.

File

vendor/symfony/console/Input/ArgvInput.php, line 189

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

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