Skip to content

Commit

Permalink
Pass along -vv and -vvv to redispatches. (#5948)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Apr 1, 2024
1 parent 9ac45d5 commit 1287da1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"consolidation/output-formatters": "^4.3.2",
"consolidation/robo": "^4.0.6",
"consolidation/site-alias": "^4",
"consolidation/site-process": "^5.2.0",
"consolidation/site-process": "^5.3.0",
"grasmash/yaml-cli": "^3.1",
"guzzlehttp/guzzle": "^7.0",
"laravel/prompts": "^0.1.15",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/Drush.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Drush;

use Psr\Container\ContainerInterface;
use Composer\InstalledVersions;
use Consolidation\AnnotatedCommand\AnnotatedCommandFactory;
use Consolidation\SiteAlias\SiteAliasInterface;
Expand All @@ -17,6 +16,7 @@
use Drush\Preflight\PreflightArgs;
use Drush\Runtime\DependencyInjection;
use Drush\SiteAlias\ProcessManager;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Robo\Robo;
use Robo\Runner;
Expand Down Expand Up @@ -446,12 +446,18 @@ public static function redispatchOptions($input = null)
// $input->getOptions() returns an associative array of option => value
$options = $input->getOptions();

// The 'runtime.options' config contains a list of option names on th cli
// The 'runtime.options' config contains a list of option names on the CLI
$optionNamesFromCommandline = self::config()->get('runtime.options');

// Attempt to normalize option names.
foreach ($optionNamesFromCommandline as $key => $name) {
try {
// Don't incorrectly remap these to --verbose, or discard them.
if ($name == 'vv' || $name == 'vvv') {
// Special handling is in \Consolidation\SiteProcess\Util\ArgumentProcessor::convertOptions
$options[$name] = true;
continue;
}
$optionNamesFromCommandline[$key] = Drush::getApplication()->get($command_name)->getDefinition()->shortcutToName($name);
} catch (InvalidArgumentException $e) {
// Do nothing. It's expected.
Expand Down

0 comments on commit 1287da1

Please sign in to comment.