From 1b78ba0e77e915f210b4d01cd14d53431f652bb6 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Thu, 21 Nov 2024 15:08:02 -0800 Subject: [PATCH] CLI-1406: Command documentation markup --- src/Command/Self/MakeDocsCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index b888f642a..ad777cc2e 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -7,6 +7,7 @@ use Acquia\Cli\Command\CommandBase; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -19,7 +20,7 @@ final class MakeDocsCommand extends CommandBase protected function configure(): void { $this->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'The format to describe the docs in.', 'rst'); - $this->addOption('dump', 'd', InputOption::VALUE_OPTIONAL, 'Dump docs to directory'); + $this->addOption('dump', 'd', InputOption::VALUE_OPTIONAL, 'Dump docs to directory (implies JSON format)'); } protected function execute(InputInterface $input, OutputInterface $output): int @@ -46,6 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } $filename = $command['name'] . '.json'; + $command['help'] = (new OutputFormatter())->format($command['help']); $index[] = [ 'command' => $command['name'], 'help' => $command['help'],