Symfony\Component\Console\Command\HelpCommand::configure PHP Метод

configure() защищенный Метод

protected configure ( )
    protected function configure()
    {
        $this->ignoreValidationErrors = true;

        $this
            ->setDefinition(array(
                new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
                new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
            ))
            ->setName('help')
            ->setDescription('Displays help for a command')
            ->setHelp(<<<EOF
The <info>help</info> command displays help for a given command:

  <info>./app/console help list</info>

You can also output the help as XML by using the <comment>--xml</comment> option:

  <info>./app/console help --xml list</info>
EOF
            );
    }

Usage Example

Пример #1
0
    protected function configure()
    {
        parent::configure();
        $this->setHelp(<<<EOF
The <info>%command.name%</info> command displays help for a given command:

  <info>vagma help <command></info>

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

  <info>vagma help --format=xml list</info>

<bg=yellow;fg=black> Beginners => </> To display the list of available commands, please use the <info>list</info> command:

  <info>vagma list</info>

EOF
);
    }