1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @package: Chapi |
4
|
|
|
* |
5
|
|
|
* @author: msiebeneicher |
6
|
|
|
* @since: 2015-07-28 |
7
|
|
|
* |
8
|
|
|
*/ |
9
|
|
|
namespace Chapi; |
10
|
|
|
|
11
|
|
|
use Symfony\Component\Console\Application; |
12
|
|
|
|
13
|
|
|
class ChapiApplication extends Application |
14
|
|
|
{ |
15
|
|
|
public function __construct($name = 'Chapi', $version = '@package_version@') |
16
|
|
|
{ |
17
|
|
|
if ('@package_version@' !== $version) { |
18
|
|
|
$version = ltrim($version, 'v'); |
|
|
|
|
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
parent::__construct($name, $version); |
22
|
|
|
|
23
|
|
|
$this->setDefaultCommand('help.commands'); |
24
|
|
|
$this->addCommands($this->getCommands()); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @return \Symfony\Component\Console\Command\Command[] |
29
|
|
|
*/ |
30
|
|
|
private function getCommands() |
31
|
|
|
{ |
32
|
|
|
return [ |
33
|
|
|
// GENERAL COMMANDS |
34
|
|
|
new Commands\AddCommand(), |
35
|
|
|
new Commands\CommitCommand(), |
36
|
|
|
new Commands\ConfigureCommand(), |
37
|
|
|
new Commands\DiffCommand(), |
38
|
|
|
new Commands\HelpCommandsCommand(), |
39
|
|
|
new Commands\InfoCommand(), |
40
|
|
|
new Commands\ListCommand(), |
41
|
|
|
new Commands\PullCommand(), |
42
|
|
|
new Commands\ResetCommand(), |
43
|
|
|
new Commands\SchedulingViewCommand(), |
44
|
|
|
new Commands\StatusCommand(), |
45
|
|
|
new Commands\ValidationCommand(), |
46
|
|
|
]; |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|