Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / drush / drush / src / Psysh / DrushCommand.php
index 4172f5d9cd826ec32c8a909ef9123c7779b658b1..30bf569bd010a08957a9406f090a3a12d403f52b 100644 (file)
@@ -43,7 +43,7 @@ class DrushCommand extends BaseCommand
      */
     public function getNamespace()
     {
-        $parts = explode('-', $this->getName());
+        $parts = explode(':', $this->getName());
         return count($parts) >= 2 ? array_shift($parts) : 'global';
     }
 
@@ -53,11 +53,11 @@ class DrushCommand extends BaseCommand
     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());
     }
 
     /**
@@ -73,20 +73,20 @@ class DrushCommand extends BaseCommand
         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);
             }