You are here

protected function HelpCommand::configure in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Command/HelpCommand.php \Symfony\Component\Console\Command\HelpCommand::configure()

Configures the current command.

Overrides Command::configure

File

vendor/symfony/console/Command/HelpCommand.php, line 32

Class

HelpCommand
HelpCommand displays the help for a given command.

Namespace

Symfony\Component\Console\Command

Code

protected function configure() {
  $this
    ->ignoreValidationErrors();
  $this
    ->setName('help')
    ->setDefinition(array(
    new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
    new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
    new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
    new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
  ))
    ->setDescription('Displays help for a command')
    ->setHelp(<<<EOF
The <info>%command.name%</info> command displays help for a given command:

  <info>php %command.full_name% list</info>

You can also output the help in other formats by using the <comment>--format</comment> option:

  <info>php %command.full_name% --format=xml list</info>

To display the list of available commands, please use the <info>list</info> command.
EOF
);
}