mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-20 06:25:04 +02:00
Control when no action is provided.
This commit is contained in:
parent
43d730f087
commit
bff9e1a8ef
|
@ -18,30 +18,34 @@ class Mage_Console
|
|||
|
||||
public function parse()
|
||||
{
|
||||
if ($this->_args[0] == 'deploy') {
|
||||
$this->_action = 'deploy';
|
||||
if (count($this->_args) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if ($this->_args[0] == 'releases') {
|
||||
$this->_action = 'releases';
|
||||
|
||||
} else if ($this->_args[0] == 'update') {
|
||||
$this->_action = 'update';
|
||||
if ($this->_args[0] == 'deploy') {
|
||||
$this->_action = 'deploy';
|
||||
|
||||
} else if ($this->_args[0] == 'add') {
|
||||
$this->_action = 'add';
|
||||
} else if ($this->_args[0] == 'releases') {
|
||||
$this->_action = 'releases';
|
||||
|
||||
} 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] == 'update') {
|
||||
$this->_action = 'update';
|
||||
|
||||
} else if ($this->_args[0] == 'init') {
|
||||
$this->_action = 'init';
|
||||
}
|
||||
} else if ($this->_args[0] == 'add') {
|
||||
$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) {
|
||||
if (preg_match('/to:[\w]+/i', $argument)) {
|
||||
|
@ -176,6 +180,10 @@ class Mage_Console
|
|||
case 'version';
|
||||
$this->showVersion();
|
||||
break;
|
||||
|
||||
default:
|
||||
Mage_Console::output('<red>Invalid action</red>', 0, 2);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($showGrettings) {
|
||||
|
|
Loading…
Reference in a new issue