public function getUsage()
    {
        $string = [];

        $string[] = $this->getName();

        foreach ($this->getArguments() as $argument) {
            if ($argument->isRequired()) {
                $string[] = $argument->getName();
            } else {
                $string[] = "[{$argument->getName()}]";
            }
        }

        foreach ($this->getOptions() as $option) {
            $dashes = '-';
            if (!$option->isFlagOption()) {
                $dashes .= '-';
            }
            if ($option->isValueRequired()) {
                $optionString = "{$option->getName()}=value";
            } else {
                $optionString = "{$option->getName()}[=value]";
            }
            $string[] = "[{$dashes}{$optionString}]";
        }

        return implode(' ', $string);
    }
public function getUsage()
    {
        $string = [];

        $string[] = $this->getName();

        foreach ($this->getArguments() as $argument) {
            if ($argument->isRequired()) {
                $string[] = $argument->getName();
            } else {
                $string[] = "[{$argument->getName()}]";
            }
        }

        foreach ($this->getOptions() as $option) {
            $dashes = '-';
            if (!$option->isFlagOption()) {
                $dashes .= '-';
            }
            if ($option->isValueRequired()) {
                $optionString = "{$option->getName()}=value";
            } else {
                $optionString = "{$option->getName()}[=value]";
            }
            $string[] = "[{$dashes}{$optionString}]";
        }

        return implode(' ', $string);
    }
public function getUsage ( ) { $ string = [ ] ; $ string [ ] = $ this -> getName ( ) ; foreach ( $ this -> getArguments ( ) as $ argument ) { if ( $ argument -> isRequired ( ) ) { $ string [ ] = $ argument -> getName ( ) ; } else { $ string [ ] = "[{$argument->getName()}]" ; } } foreach ( $ this -> getOptions ( ) as $ option ) { $ dashes = '-' ; if ( ! $ option -> isFlagOption ( ) ) { $ dashes .= '-' ; } if ( $ option -> isValueRequired ( ) ) { $ optionString = "{$option->getName()}=value" ; } else { $ optionString = "{$option->getName()}[=value]" ; } $ string [ ] = "[{$dashes}{$optionString}]" ; } return implode ( ' ' , $ string ) ; }
Build a usage string out of the arguments and options set on the command.
Is automatically called when an exception is caught by App.

@return string
Build a usage string out of the arguments and options set on the command . Is automatically called when an exception is caught by App .