*/
class ListCommand extends Command
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('list')
->setDefinition([
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'),
])
->setDescription('List commands')
->setHelp("The %command.name% command lists all commands:\n\n %command.full_name%\n\nYou can also display the commands for a specific namespace:\n\n %command.full_name% test\n\nYou can also output the information in other formats by using the --format option:\n\n %command.full_name% --format=xml\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n %command.full_name% --raw"
)
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$helper = new DescriptorHelper();
$helper->describe($output, $this->getApplication(), [
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
'namespace' => $input->getArgument('namespace'),
'short' => $input->getOption('short'),
]);
return 0;
}
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if ($input->mustSuggestArgumentValuesFor('namespace')) {
$descriptor = new ApplicationDescription($this->getApplication());
$suggestions->suggestValues(array_keys($descriptor->getNamespaces()));
return;
}
if ($input->mustSuggestOptionValuesFor('format')) {
$helper = new DescriptorHelper();
$suggestions->suggestValues($helper->getFormats());
}
}
}
__halt_compiler();----SIGNATURE:----Um9REF85OtgRtuFVWWScdZw2XhXwQDKlJP+h0w/DQ3cHYHo2Rp0noyjgAA4/LxBRHKqMF0NHLQL9MIlNYxktEXjx33uYouXcbneGV/5+P2WKml/oj3qJcw1c6rcCEMUZT78USuDWmoq30Yjcxc6vmxkvmlRL9dFKV5C74UgBoQK99v4hDrCuToKUo/rnYJ9tf3rPnXGk7wYR8451UKNffEY/Au0hkYHFYUX8qnaeT3hW5oTr8EoAbSQwbtM6sZSbE2fq/toaoVWHak+MQ5rUcgkIzqJ0obKCUBji2X796Z/FkCii7KA8ccqj+Hf+r1b7aAt9b1lOSMdMrNc9kS4oHIJNPk2hRy1Qs0psq2RhBzcoD0Q6gFwQwV7NtrvYGTST3yWgfXQJxJnbWX1eenHnFVM3qVwVtRDmiP30iryliA5sLXBZcFq8/YY3GhTmh+ORy9XT/+iM5nYS7xQHkgT1JtM03RhvCsC1o82KozY82jV0mfXOibl7QcxfqZ3NzjHWj/rjNELeO/J6ijtWbdbdraoDy1emoV7fQiYmVmca27hiso/svJ4gQwRdqkVFVAHsEbifKB5az/KvTyEnjuvVT8v9r2Xt+gdOZ2S1FNDGzRzU7OaO6PMgYWLG3XyQO1fjJkq2j8muw/E9FvhOPJhZHwPUA7wlKoEHa8oB4aE2RB8=----ATTACHMENT:----OTcxNzc4NjM5NDY2NzU5MiA2OTI1NDAyMjQ1NDE3NjE3IDQxMjgzOTg5NDUxOTY5NjU=