Control when no action is provided.

This commit is contained in:
Andrs Montaez 2012-02-04 15:45:28 -02:00
parent 43d730f087
commit bff9e1a8ef

View file

@ -18,30 +18,34 @@ class Mage_Console
public function parse() public function parse()
{ {
if ($this->_args[0] == 'deploy') { if (count($this->_args) == 0) {
$this->_action = 'deploy'; return false;
}
} else if ($this->_args[0] == 'releases') { if ($this->_args[0] == 'deploy') {
$this->_action = 'releases'; $this->_action = 'deploy';
} else if ($this->_args[0] == 'update') {
$this->_action = 'update';
} else if ($this->_args[0] == 'add') { } else if ($this->_args[0] == 'releases') {
$this->_action = 'add'; $this->_action = 'releases';
} else if ($this->_args[0] == 'install') { } else if ($this->_args[0] == 'update') {
$this->_action = 'install'; $this->_action = 'update';
} else if ($this->_args[0] == 'upgrade') {
$this->_action = 'upgrade';
} else if ($this->_args[0] == 'version') {
$this->_action = 'version';
} else if ($this->_args[0] == 'init') { } else if ($this->_args[0] == 'add') {
$this->_action = 'init'; $this->_action = 'add';
}
} else if ($this->_args[0] == 'install') {
$this->_action = 'install';
} else if ($this->_args[0] == 'upgrade') {
$this->_action = 'upgrade';
} else if ($this->_args[0] == 'version') {
$this->_action = 'version';
} else if ($this->_args[0] == 'init') {
$this->_action = 'init';
}
foreach ($this->_args as $argument) { foreach ($this->_args as $argument) {
if (preg_match('/to:[\w]+/i', $argument)) { if (preg_match('/to:[\w]+/i', $argument)) {
@ -176,6 +180,10 @@ class Mage_Console
case 'version'; case 'version';
$this->showVersion(); $this->showVersion();
break; break;
default:
Mage_Console::output('<red>Invalid action</red>', 0, 2);
break;
} }
if ($showGrettings) { if ($showGrettings) {