Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler::completeForOptionShortcutValues PHP Method

completeForOptionShortcutValues() protected method

Attempt to complete the current word as the value of an option shortcut
protected completeForOptionShortcutValues ( ) : array | false
return array | false
    protected function completeForOptionShortcutValues()
    {
        $wordIndex = $this->context->getWordIndex();
        if ($this->command && $wordIndex > 1) {
            $left = $this->context->getWordAtIndex($wordIndex - 1);
            // Complete short options
            if ($left[0] == '-' && strlen($left) == 2) {
                $shortcut = substr($left, 1);
                $def = $this->command->getNativeDefinition();
                if (!$def->hasShortcut($shortcut)) {
                    return false;
                }
                $opt = $def->getOptionForShortcut($shortcut);
                if ($opt->isValueRequired() || $opt->isValueOptional()) {
                    return $this->completeOption($opt);
                }
            }
        }
        return false;
    }