File tree 5 files changed +40
-0
lines changed
5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ dev-master
6
6
7
7
### Features
8
8
9
+ - [ shell] Added "shell: clear " command to support clearing the console output
9
10
- [ general] The shell supports being embedded as a dependency
10
11
- [ node: edit ] New command ` node:edit ` enables editing of entire node
11
12
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()
227
227
{
228
228
// add shell-specific commands
229
229
$ this ->add (new CommandShell \AliasListCommand ());
230
+ $ this ->add (new CommandShell \ClearCommand ());
230
231
$ this ->add (new CommandShell \ConfigInitCommand ());
231
232
$ this ->add (new CommandShell \ConfigReloadCommand ());
232
233
$ 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 2
2
aliases : shell:alias:list
3
3
creload : shell:config:reload
4
4
cinit : shell:config:init
5
+ clear : shell:clear
5
6
6
7
# MySQL commands
7
8
use : workspace:use {arg1}
You can’t perform that action at this time.
0 commit comments