*/
public function getNamespace()
{
- $parts = explode('-', $this->getName());
+ $parts = explode(':', $this->getName());
return count($parts) >= 2 ? array_shift($parts) : 'global';
}
protected function configure()
{
$this
- ->setName($this->command->getName())
- ->setAliases($this->command->getAliases())
- ->setDefinition($this->command->getDefinition())
- ->setDescription($this->command->getDescription())
- ->setHelp($this->buildHelpFromCommand());
+ ->setName($this->command->getName())
+ ->setAliases($this->command->getAliases())
+ ->setDefinition($this->command->getDefinition())
+ ->setDescription($this->command->getDescription())
+ ->setHelp($this->buildHelpFromCommand());
}
/**
if (strpos($first, '@') === 0) {
$alias = $first;
$command = array_shift($args);
- } // Otherwise, default the alias to '@self' and use the first argument as the
- // command.
- else {
+ } else {
+ // Otherwise, default the alias to '@self' and use the first argument as the
+ // command.
$alias = '@self';
$command = $first;
}
- $options = $input->getOptions();
+ $options = array_diff_assoc($input->getOptions(), $this->getDefinition()->getOptionDefaults());
// Force the 'backend' option to TRUE.
$options['backend'] = true;
$return = drush_invoke_process($alias, $command, array_values($args), $options, ['interactive' => true]);
- if ($return['error_status'] > 0) {
+ if (($return['error_status'] > 0) && !empty($return['error_log'])) {
foreach ($return['error_log'] as $error_type => $errors) {
$output->write($errors);
}