diff --git a/lib/Doctrine/Common/Cli/CliController.php b/lib/Doctrine/Common/Cli/CliController.php index f6532411e..a36984d8b 100644 --- a/lib/Doctrine/Common/Cli/CliController.php +++ b/lib/Doctrine/Common/Cli/CliController.php @@ -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); } diff --git a/lib/Doctrine/Common/Cli/TaskNamespace.php b/lib/Doctrine/Common/Cli/TaskNamespace.php index dc7a5e9e8..017e99ac9 100644 --- a/lib/Doctrine/Common/Cli/TaskNamespace.php +++ b/lib/Doctrine/Common/Cli/TaskNamespace.php @@ -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'])) {