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;
    }
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;
    }
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 ; }
Attempt to complete the current word as the value of an option shortcut

@return array|false
Attempt to complete the current word as the value of an option shortcut