Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArgvInput.php

function ArgvInput::parseShortOption

Parses a short option.

1 call to ArgvInput::parseShortOption()
ArgvInput::parseToken in vendor/symfony/console/Input/ArgvInput.php

File

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

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

private function parseShortOption(string $token) : void {
    $name = substr($token, 1);
    if (\strlen($name) > 1) {
        if ($this->definition
            ->hasShortcut($name[0]) && $this->definition
            ->getOptionForShortcut($name[0])
            ->acceptValue()) {
            // an option with a value (with no space)
            $this->addShortOption($name[0], substr($name, 1));
        }
        else {
            $this->parseShortOptionSet($name);
        }
    }
    else {
        $this->addShortOption($name, null);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal