File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ dev-master
66
77### Features
88
9+ - [ shell] Added "shell: clear " command to support clearing the console output
910- [ general] The shell supports being embedded as a dependency
1011- [ node: edit ] New command ` node:edit ` enables editing of entire node
1112
Original file line number Diff line number Diff line change 1+ Feature : clear the screen
2+ In order to clear the screen
3+ As a user
4+ I want to be able to execute a command which does that.
5+
6+ Background :
7+ Given that I am logged in as "testuser"
8+
9+ Scenario : Execute the shell clear command
10+ Given I execute the "shell:clear" command
11+ Then the command should not fail
Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ protected function registerShellCommands()
227227 {
228228 // add shell-specific commands
229229 $ this ->add (new CommandShell \AliasListCommand ());
230+ $ this ->add (new CommandShell \ClearCommand ());
230231 $ this ->add (new CommandShell \ConfigInitCommand ());
231232 $ this ->add (new CommandShell \ConfigReloadCommand ());
232233 $ this ->add (new CommandShell \PathChangeCommand ());
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PHPCR \Shell \Console \Command \Shell ;
4+
5+ use Symfony \Component \Console \Command \Command ;
6+ use Symfony \Component \Console \Input \InputInterface ;
7+ use Symfony \Component \Console \Output \OutputInterface ;
8+
9+ class ClearCommand extends Command
10+ {
11+ public function configure ()
12+ {
13+ $ this ->setName ('shell:clear ' );
14+ $ this ->setDescription ('Clear the screen ' );
15+ $ this ->setHelp (<<<EOT
16+ Clear the screen
17+ EOT
18+ );
19+ }
20+
21+ public function execute (InputInterface $ input , OutputInterface $ output )
22+ {
23+ $ output ->write ("\033[2J \033[;H " );
24+ }
25+ }
26+
Original file line number Diff line number Diff line change 22aliases : shell:alias:list
33creload : shell:config:reload
44cinit : shell:config:init
5+ clear : shell:clear
56
67# MySQL commands
78use : workspace:use {arg1}
You can’t perform that action at this time.
0 commit comments