1
0
mirror of synced 2025-01-31 04:21:44 +03:00

[2.0][DDC-223] Enhanced CLI re-importing the Global Arguments functionality

This commit is contained in:
guilhermeblanco 2010-01-06 17:55:55 +00:00
parent 3ec23c7272
commit d2b59d7a72
2 changed files with 6 additions and 5 deletions

View File

@ -162,11 +162,6 @@ class CliController extends AbstractNamespace
$taskName = array_pop($taskPath);
$taskNamespace = $this->_retrieveTaskNamespace($taskPath);
// Merge global configuration if it exists
if (($globalArgs = $this->getConfiguration()->getAttribute('globalArguments')) !== null) {
$args = array_merge($globalArgs, $args);
}
$taskNamespace->runTask($taskName, $args);
}

View File

@ -213,6 +213,12 @@ class TaskNamespace extends AbstractNamespace
{
try {
$task = $this->getTask($name);
// Merge global configuration if it exists
if (($globalArgs = $this->getConfiguration()->getAttribute('globalArguments')) !== null) {
$arguments = array_merge($globalArgs, $arguments);
}
$task->setArguments($arguments);
if ((isset($arguments['help']) && $arguments['help']) || (isset($arguments['h']) && $arguments['h'])) {