Browse Source

Implement mark's suggestion to avoid breaking people's workflow

https://xkcd.com/1172/
Rachman Chavik 8 years ago
parent
commit
f2d347ae41
2 changed files with 17 additions and 10 deletions
  1. 1 10
      src/Console/Shell.php
  2. 16 0
      src/Shell/CommandListShell.php

+ 1 - 10
src/Console/Shell.php

@@ -273,9 +273,7 @@ class Shell
     public function startup()
     {
         if (!$this->param('requested')) {
-            if (!$this->args) {
-                $this->_welcome();
-            }
+            $this->_welcome();
         }
     }
 
@@ -286,13 +284,6 @@ class Shell
      */
     protected function _welcome()
     {
-        $this->out();
-        $this->out(sprintf('<info>Welcome to CakePHP %s Console</info>', 'v' . Configure::version()));
-        $this->hr();
-        $this->out(sprintf('App : %s', APP_DIR));
-        $this->out(sprintf('Path: %s', APP));
-        $this->out(sprintf('PHP : %s', phpversion()));
-        $this->hr();
     }
 
     /**

+ 16 - 0
src/Shell/CommandListShell.php

@@ -38,6 +38,22 @@ class CommandListShell extends Shell
     public $tasks = ['Command'];
 
     /**
+     * Displays a header for the shell
+     *
+     * @return void
+     */
+    protected function _welcome()
+    {
+        $this->out();
+        $this->out(sprintf('<info>Welcome to CakePHP %s Console</info>', 'v' . Configure::version()));
+        $this->hr();
+        $this->out(sprintf('App : %s', APP_DIR));
+        $this->out(sprintf('Path: %s', APP));
+        $this->out(sprintf('PHP : %s', phpversion()));
+        $this->hr();
+    }
+
+    /**
      * startup
      *
      * @return void