From c90e817b4145ede32c7cdc3288d210c3bf0bbd91 Mon Sep 17 00:00:00 2001 From: Josh Waihi Date: Mon, 18 Dec 2023 14:26:58 +1300 Subject: [PATCH] Allow other descriptor formats to be used to render docs. --- src/Command/Self/MakeDocsCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Command/Self/MakeDocsCommand.php b/src/Command/Self/MakeDocsCommand.php index c37b562a5..0918829e6 100644 --- a/src/Command/Self/MakeDocsCommand.php +++ b/src/Command/Self/MakeDocsCommand.php @@ -6,6 +6,7 @@ use Acquia\Cli\Attribute\RequireAuth; use Acquia\Cli\Command\CommandBase; +use Composer\Console\Input\InputOption; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\DescriptorHelper; @@ -16,11 +17,15 @@ #[AsCommand(name: 'self:make-docs', description: 'Generate documentation for all ACLI commands', hidden: TRUE)] final class MakeDocsCommand extends CommandBase { + protected function configure(): void { + $this->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'The format to describe the docs in.', 'rst'); + } + protected function execute(InputInterface $input, OutputInterface $output): int { $helper = new DescriptorHelper(); $helper->describe($output, $this->getApplication(), [ - 'format' => 'rst', + 'format' => $input->getOption('format'), ]); return Command::SUCCESS;