-
Notifications
You must be signed in to change notification settings - Fork 18
/
Application.php
46 lines (39 loc) · 1.29 KB
/
Application.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
44
45
46
<?php
namespace Dissect\Console;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
/**
* The CLI application.
*
* @author Jakub Lédl <jakubledl@gmail.com>
*/
class Application extends BaseApplication
{
// credit goes to everzet & kostiklv, since
// I copied the BehatApplication class when
// dealing with some CLI problems.
public function __construct($version)
{
parent::__construct('Dissect', $version);
}
protected function getCommandName(InputInterface $input)
{
return 'dissect';
}
protected function getDefaultCommands()
{
$default = parent::getDefaultCommands();
$default[] = new Command\DissectCommand();
return $default;
}
public function getDefinition()
{
return new InputDefinition(array(
new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'),
new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase verbosity of exceptions.'),
new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display version information.'),
));
}
}