부터: 1.0
저자: Bernhard Schussek (bschussek@gmail.com)
상속: extends AbstractHelp
예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function handle(Args $args, IO $io, Command $command)
 {
     $application = $command->getApplication();
     if ($args->isArgumentSet('command')) {
         $theCommand = $application->getCommand($args->getArgument('command'));
         $usage = new CommandHelp($theCommand);
     } else {
         $usage = new ApplicationHelp($application);
     }
     $usage->render($io);
     return 0;
 }
예제 #2
0
    public function testRenderDescription()
    {
        $config = ApplicationConfig::create()->setHelp('The help');
        $application = new ConsoleApplication($config);
        $help = new ApplicationHelp($application);
        $help->render($this->io);
        $expected = <<<'EOF'
Console Tool

USAGE
  console <command> [<arg1>] ... [<argN>]

ARGUMENTS
  <command>  The command to execute
  <arg>      The arguments of the command

DESCRIPTION
  The help


EOF;
        $this->assertSame($expected, $this->io->fetchOutput());
    }