Skip to content

Commit

Permalink
Allow other descriptor formats to be used to render docs. (#1655)
Browse files Browse the repository at this point in the history
* Allow other descriptor formats to be used to render docs.

* Fixed use of incorrect namespace.
  • Loading branch information
fiasco authored Dec 18, 2023
1 parent db16290 commit 0e06f53
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 @@ -10,17 +10,22 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[RequireAuth]
#[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 0e06f53

Please sign in to comment.