-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelpCommand.php
43 lines (39 loc) · 1.06 KB
/
HelpCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Webdevvie\Pakket;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class HelpCommand
* @package Webdevvie\Pakket
*/
class HelpCommand extends Command
{
/**
* @return void
*/
protected function configure()
{
$this
->setName('help')
->setDescription('Displays a help message');
}
/**
* @param InputInterface $input
* @param OutputInterface $output
* @throws \Exception
* @return integer
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln(file_get_contents(__DIR__ . '/help.txt'));
$arguments = array(
'command' => 'list',
'--help'
);
$this->getApplication()->find('list')->run(new ArrayInput($arguments), $output);
return self::SUCCESS;
}
}