Skip to content

Commit

Permalink
Moving the clear command into the shell dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Jul 24, 2009
1 parent b2142df commit ae74dca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cake/console/cake
Expand Up @@ -22,8 +22,6 @@
# @license http://www.opensource.org/licenses/mit-license.php The MIT License
#
################################################################################
clear

LIB=${0/%cake/}
APP=`pwd`

Expand Down
17 changes: 17 additions & 0 deletions cake/console/cake.php
Expand Up @@ -286,6 +286,22 @@ function __bootstrap() {
return true;
}

/**
* Clear the console
*
* @return void
* @access public
*/
function clear() {
if (empty($this->params['noclear'])) {
if ( DS === '/') {
passthru('clear');
} else {
passthru('cls');
}
}
}

/**
* Dispatches a CLI request
*
Expand Down Expand Up @@ -557,6 +573,7 @@ function shiftArgs() {
* @access public
*/
function help() {
$this->clear();
$this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console");
$this->stdout("---------------------------------------------------------------");
$this->stdout("Current Paths:");
Expand Down
1 change: 1 addition & 0 deletions cake/console/libs/shell.php
Expand Up @@ -204,6 +204,7 @@ function startup() {
* @access protected
*/
function _welcome() {
$this->Dispatcher->clear();
$this->out("\nWelcome to CakePHP v" . Configure::version() . " Console");
$this->out("---------------------------------------------------------------");
$this->out('App : '. $this->params['app']);
Expand Down

0 comments on commit ae74dca

Please sign in to comment.