Permalink
Browse files

Updating Shell class to use nl() where possible.

  • Loading branch information...
1 parent 5ac7361 commit 86274357b99579df175be83df9b31d3262b4b2f9 @davidpersson davidpersson committed Sep 21, 2009
Showing with 7 additions and 6 deletions.
  1. +7 −6 cake/console/libs/shell.php
@@ -206,7 +206,7 @@ function startup() {
function _welcome() {
$this->Dispatch->clear();
$this->out("\nWelcome to CakePHP v" . Configure::version() . " Console");
- $this->out("---------------------------------------------------------------");
+ $this->hr();
$this->out('App : '. $this->params['app']);
$this->out('Path: '. $this->params['working']);
$this->hr();
@@ -456,14 +456,14 @@ function _checkArgs($expectedNum, $command = null) {
*/
function createFile ($path, $contents) {
$path = str_replace(DS . DS, DS, $path);
- $this->out("\n" . sprintf(__("Creating file %s", true), $path));
+ $this->out($this->nl() . sprintf(__("Creating file %s", true), $path));
if (is_file($path) && $this->interactive === true) {
$key = $this->in(__("File exists, overwrite?", true). " {$path}", array('y', 'n', 'q'), 'n');
if (strtolower($key) == 'q') {
- $this->out(__("Quitting.", true) ."\n");
+ $this->out(__("Quitting.", true), 2);
exit;
} elseif (strtolower($key) != 'y') {
- $this->out(__("Skip", true) ." {$path}\n");
+ $this->out(__("Skip", true) ." {$path}", 2);
return false;
}
}
@@ -477,7 +477,7 @@ function createFile ($path, $contents) {
$this->out(__("Wrote", true) ." {$path}");
return true;
} else {
- $this->err(__("Error! Could not write to", true)." {$path}.\n");
+ $this->err(__("Error! Could not write to", true)." {$path}", 2);
return false;
}
}
@@ -489,7 +489,8 @@ function createFile ($path, $contents) {
*/
function help() {
if ($this->command != null) {
- $this->err("Unknown {$this->name} command '$this->command'.\nFor usage, try 'cake {$this->shell} help'.\n\n");
+ $this->err("Unknown {$this->name} command '$this->command'.");
+ $this->err("For usage, try 'cake {$this->shell} help'.", 2);
} else {
$this->Dispatch->help();
}

0 comments on commit 8627435

Please sign in to comment.