PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.8.2
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.8.2
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / prefixed / symfony / console / Command / HelpCommand.php
matomo / app / vendor / prefixed / symfony / console / Command Last commit date
Command.php 1 year ago CompleteCommand.php 1 year ago DumpCompletionCommand.php 2 years ago HelpCommand.php 2 years ago LazyCommand.php 1 year ago ListCommand.php 2 years ago LockableTrait.php 1 year ago SignalableCommandInterface.php 2 years ago
HelpCommand.php
78 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace Matomo\Dependencies\Symfony\Component\Console\Command;
12
13 use Matomo\Dependencies\Symfony\Component\Console\Completion\CompletionInput;
14 use Matomo\Dependencies\Symfony\Component\Console\Completion\CompletionSuggestions;
15 use Matomo\Dependencies\Symfony\Component\Console\Descriptor\ApplicationDescription;
16 use Matomo\Dependencies\Symfony\Component\Console\Helper\DescriptorHelper;
17 use Matomo\Dependencies\Symfony\Component\Console\Input\InputArgument;
18 use Matomo\Dependencies\Symfony\Component\Console\Input\InputInterface;
19 use Matomo\Dependencies\Symfony\Component\Console\Input\InputOption;
20 use Matomo\Dependencies\Symfony\Component\Console\Output\OutputInterface;
21 /**
22 * HelpCommand displays the help for a given command.
23 *
24 * @author Fabien Potencier <fabien@symfony.com>
25 */
26 class HelpCommand extends Command
27 {
28 private $command;
29 /**
30 * {@inheritdoc}
31 */
32 protected function configure()
33 {
34 $this->ignoreValidationErrors();
35 $this->setName('help')->setDefinition([new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), 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('Display help for a command')->setHelp(<<<'EOF'
36 The <info>%command.name%</info> command displays help for a given command:
37
38 <info>%command.full_name% list</info>
39
40 You can also output the help in other formats by using the <comment>--format</comment> option:
41
42 <info>%command.full_name% --format=xml list</info>
43
44 To display the list of available commands, please use the <info>list</info> command.
45 EOF
46 );
47 }
48 public function setCommand(Command $command)
49 {
50 $this->command = $command;
51 }
52 /**
53 * {@inheritdoc}
54 */
55 protected function execute(InputInterface $input, OutputInterface $output)
56 {
57 if (null === $this->command) {
58 $this->command = $this->getApplication()->find($input->getArgument('command_name'));
59 }
60 $helper = new DescriptorHelper();
61 $helper->describe($output, $this->command, ['format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw')]);
62 $this->command = null;
63 return 0;
64 }
65 public function complete(CompletionInput $input, CompletionSuggestions $suggestions) : void
66 {
67 if ($input->mustSuggestArgumentValuesFor('command_name')) {
68 $descriptor = new ApplicationDescription($this->getApplication());
69 $suggestions->suggestValues(array_keys($descriptor->getCommands()));
70 return;
71 }
72 if ($input->mustSuggestOptionValuesFor('format')) {
73 $helper = new DescriptorHelper();
74 $suggestions->suggestValues($helper->getFormats());
75 }
76 }
77 }
78