public function write( Command $command, Option $option = NULL )
    {
        $output = PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL;
        $output .= $command->name . ' ' . $command->version . PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL;
        $output .= $command->copyright . PHP_EOL;
        $output .= $command->description . PHP_EOL;
        $output .= 'Support: ' . $command->supportSite . PHP_EOL;
        $output .= 'Source: ' . $command->supportSource . PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL . PHP_EOL;

        $output .= 'Usage: ' . $this->_getUsageExample( $command );

        if ( NULL !== $option && !empty( $option->longDescription ) ) // detailed help for single option
        {
            $output .= $option->longDescription . PHP_EOL;
        }
        else // short overview of each option
        {
            $str = '';

            foreach ( $command->options as $option )
            {
                $str .= sprintf( " --%-8s (-%s) %-6s%s",
                                 $option->longCode, $option->shortCode, $option->shortDescription, PHP_EOL
                );
            }

            $output .= $str;
        }

        echo $output;
    }
public function write( Command $command, Option $option = NULL )
    {
        $output = PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL;
        $output .= $command->name . ' ' . $command->version . PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL;
        $output .= $command->copyright . PHP_EOL;
        $output .= $command->description . PHP_EOL;
        $output .= 'Support: ' . $command->supportSite . PHP_EOL;
        $output .= 'Source: ' . $command->supportSource . PHP_EOL;
        $output .= '-----------------------------------------------------' . PHP_EOL . PHP_EOL;

        $output .= 'Usage: ' . $this->_getUsageExample( $command );

        if ( NULL !== $option && !empty( $option->longDescription ) ) // detailed help for single option
        {
            $output .= $option->longDescription . PHP_EOL;
        }
        else // short overview of each option
        {
            $str = '';

            foreach ( $command->options as $option )
            {
                $str .= sprintf( " --%-8s (-%s) %-6s%s",
                                 $option->longCode, $option->shortCode, $option->shortDescription, PHP_EOL
                );
            }

            $output .= $str;
        }

        echo $output;
    }
public function write ( Command $ command , Option $ option = NULL ) { $ output = PHP_EOL ; $ output .= '-----------------------------------------------------' . PHP_EOL ; $ output .= $ command -> name . ' ' . $ command -> version . PHP_EOL ; $ output .= '-----------------------------------------------------' . PHP_EOL ; $ output .= $ command -> copyright . PHP_EOL ; $ output .= $ command -> description . PHP_EOL ; $ output .= 'Support: ' . $ command -> supportSite . PHP_EOL ; $ output .= 'Source: ' . $ command -> supportSource . PHP_EOL ; $ output .= '-----------------------------------------------------' . PHP_EOL . PHP_EOL ; $ output .= 'Usage: ' . $ this -> _getUsageExample ( $ command ) ; if ( NULL !== $ option && ! empty ( $ option -> longDescription ) ) // detailed help for single option { $ output .= $ option -> longDescription . PHP_EOL ; } else // short overview of each option { $ str = '' ; foreach ( $ command -> options as $ option ) { $ str .= sprintf ( " --%-8s (-%s) %-6s%s" , $ option -> longCode , $ option -> shortCode , $ option -> shortDescription , PHP_EOL ) ; } $ output .= $ str ; } echo $ output ; }
This method writes the help to the console.

@param Command $command the command instance
@param Option  $option  optional option
This method writes the help to the console .