public function getSynopsis($short = false): string
    {
        $key = $short ? 'short' : 'long';
        if (isset($this->synopsis[$key])) {
            return $this->synopsis[$key];
        }

        $elements = [];
        if ($short && $this->hasOptions()) {
            $elements[] = '[options]';
        } elseif (!$short) {
            foreach ($this->getOptions() as $argumentDefinition) {
                $value = '';
                if ($argumentDefinition->acceptsValue()) {
                    $value = ' ' . strtoupper($argumentDefinition->getOptionName());
                }
                $elements[] = sprintf('[%s%s]', $argumentDefinition->getDashedName(), $value);
            }
        }
        if (count($elements) && $this->hasRequiredArguments()) {
            $elements[] = '[--]';
        }
        foreach ($this->getArguments() as $argumentDefinition) {
            $elements[] = '<' . $argumentDefinition->getName() . '>';
        }

        return $this->synopsis[$key] = implode(' ', $elements);
    }
public function getSynopsis($short = false): string
    {
        $key = $short ? 'short' : 'long';
        if (isset($this->synopsis[$key])) {
            return $this->synopsis[$key];
        }

        $elements = [];
        if ($short && $this->hasOptions()) {
            $elements[] = '[options]';
        } elseif (!$short) {
            foreach ($this->getOptions() as $argumentDefinition) {
                $value = '';
                if ($argumentDefinition->acceptsValue()) {
                    $value = ' ' . strtoupper($argumentDefinition->getOptionName());
                }
                $elements[] = sprintf('[%s%s]', $argumentDefinition->getDashedName(), $value);
            }
        }
        if (count($elements) && $this->hasRequiredArguments()) {
            $elements[] = '[--]';
        }
        foreach ($this->getArguments() as $argumentDefinition) {
            $elements[] = '<' . $argumentDefinition->getName() . '>';
        }

        return $this->synopsis[$key] = implode(' ', $elements);
    }
public function getSynopsis ( $ short = false ) : string { $ key = $ short ? 'short' : 'long' ; if ( isset ( $ this -> synopsis [ $ key ] ) ) { return $ this -> synopsis [ $ key ] ; } $ elements = [ ] ; if ( $ short && $ this -> hasOptions ( ) ) { $ elements [ ] = '[options]' ; } elseif ( ! $ short ) { foreach ( $ this -> getOptions ( ) as $ argumentDefinition ) { $ value = '' ; if ( $ argumentDefinition -> acceptsValue ( ) ) { $ value = ' ' . strtoupper ( $ argumentDefinition -> getOptionName ( ) ) ; } $ elements [ ] = sprintf ( '[%s%s]' , $ argumentDefinition -> getDashedName ( ) , $ value ) ; } } if ( count ( $ elements ) && $ this -> hasRequiredArguments ( ) ) { $ elements [ ] = '[--]' ; } foreach ( $ this -> getArguments ( ) as $ argumentDefinition ) { $ elements [ ] = '<' . $ argumentDefinition -> getName ( ) . '>' ; } return $ this -> synopsis [ $ key ] = implode ( ' ' , $ elements ) ; }
Get synopsis for this command, either short or long

@param bool $short
@return string
Get synopsis for this command either short or long