function ArgvInput::parseShortOptionSet
Parses a short option set.
Throws
RuntimeException When option given doesn't exist
1 call to ArgvInput::parseShortOptionSet()
- ArgvInput::parseShortOption in vendor/
symfony/ console/ Input/ ArgvInput.php - Parses a short option.
File
-
vendor/
symfony/ console/ Input/ ArgvInput.php, line 122
Class
- ArgvInput
- ArgvInput represents an input coming from the CLI arguments.
Namespace
Symfony\Component\Console\InputCode
private function parseShortOptionSet(string $name) : void {
$len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition
->hasShortcut($name[$i])) {
$encoding = mb_detect_encoding($name, null, true);
throw new RuntimeException(\sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding)));
}
$option = $this->definition
->getOptionForShortcut($name[$i]);
if ($option->acceptValue()) {
$this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1));
break;
}
$this->addLongOption($option->getName(), null);
}
}