-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeepApplication.php
More file actions
81 lines (64 loc) · 2.55 KB
/
KeepApplication.php
File metadata and controls
81 lines (64 loc) · 2.55 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
namespace STS\Keep;
use Illuminate\Console\Application;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Arr;
use STS\Keep\Data\Collections\VaultConfigCollection;
use STS\Keep\Data\Settings;
use STS\Keep\Enums\KeepInstall;
use Symfony\Component\Console\Input\InputDefinition;
class KeepApplication extends Application
{
public const string VERSION = '1.0.0-beta.8';
public function __construct(protected KeepInstall $install)
{
$container = KeepContainer::getInstance();
$events = new Dispatcher($container);
$container->instance(Dispatcher::class, $events);
parent::__construct($container, $events, self::VERSION);
$this->setName('Keep');
$container->instance(
KeepManager::class,
new KeepManager(Settings::load(), VaultConfigCollection::load())
);
$this->resolveCommands([
Commands\InfoCommand::class,
Commands\InitCommand::class,
Commands\VaultAddCommand::class,
Commands\VaultEditCommand::class,
Commands\VaultDeleteCommand::class,
Commands\VaultListCommand::class,
Commands\EnvAddCommand::class,
Commands\EnvRemoveCommand::class,
Commands\WorkspaceCommand::class,
Commands\GetCommand::class,
Commands\SetCommand::class,
Commands\CopyCommand::class,
Commands\DeleteCommand::class,
Commands\RenameCommand::class,
Commands\HistoryCommand::class,
Commands\SearchCommand::class,
Commands\ShowCommand::class,
Commands\ImportCommand::class,
Commands\ExportCommand::class,
Commands\DiffCommand::class,
Commands\VerifyCommand::class,
Commands\IamCommand::class,
Commands\TemplateValidateCommand::class,
Commands\TemplateAddCommand::class,
Commands\ShellCommand::class,
Commands\ServerCommand::class,
Commands\RunCommand::class,
]);
// Make shell the default command when running 'keep' without arguments
// Second parameter false = still allow other commands to be run
$this->setDefaultCommand('shell', false);
}
#[\Override]
protected function getDefaultInputDefinition(): InputDefinition
{
return tap(parent::getDefaultInputDefinition(), function ($definitions) {
$definitions->setOptions(Arr::except($definitions->getOptions(), ['env']));
});
}
}