Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass along -vv and -vvv to redispatches. #5948

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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