2 namespace Consolidation\AnnotatedCommand\Help;
4 use Symfony\Component\Console\Application;
5 use Symfony\Component\Console\Descriptor\XmlDescriptor;
6 use Symfony\Component\Console\Input\InputInterface;
7 use Symfony\Component\Console\Output\OutputInterface;
11 /** var Application */
12 protected $application;
15 * Create a help document from a Symfony Console command
17 public function __construct(Application $application)
19 $this->application = $application;
22 public function getApplication()
24 return $this->application;
28 * Run the help command
31 * @return \Consolidation\AnnotatedCommand\Help\HelpDocument
33 public function help($commandName = 'help')
35 $command = $this->getApplication()->find($commandName);
37 $helpDocument = $this->getHelpDocument($command);
42 * Create a help document.
44 protected function getHelpDocument($command)
46 return new HelpDocument($command);