Browse Source

Control when no action is provided.

1.0
Andrs Montaez 13 years ago
parent
commit
bff9e1a8ef
  1. 42
      Mage/Console.php

42
Mage/Console.php

@ -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') { } else if ($this->_args[0] == 'releases') {
$this->_action = 'update'; $this->_action = 'releases';
} else if ($this->_args[0] == 'add') { } else if ($this->_args[0] == 'update') {
$this->_action = 'add'; $this->_action = 'update';
} else if ($this->_args[0] == 'install') { } else if ($this->_args[0] == 'add') {
$this->_action = 'install'; $this->_action = 'add';
} else if ($this->_args[0] == 'upgrade') { } else if ($this->_args[0] == 'install') {
$this->_action = 'upgrade'; $this->_action = 'install';
} else if ($this->_args[0] == 'version') { } else if ($this->_args[0] == 'upgrade') {
$this->_action = 'version'; $this->_action = 'upgrade';
} else if ($this->_args[0] == 'init') { } else if ($this->_args[0] == 'version') {
$this->_action = 'init'; $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) {

Loading…
Cancel
Save