Skip to content

Commit

Permalink
Allow other descriptor formats to be used to render docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiasco committed Dec 18, 2023
1 parent ce271ed commit c90e817
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Command/Self/MakeDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit c90e817

Please sign in to comment.