From 8287981805093590adbf9b1cf4891c1e15fcd96f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 4 Sep 2026 10:24:55 +0200 Subject: [PATCH] [ax] Deprecate -n shortcut for --dry-run, suggest --dry-run --- src/Console/Command/ProcessCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Console/Command/ProcessCommand.php b/src/Console/Command/ProcessCommand.php index 9aa71ad434f..c5305b22bf0 100644 --- a/src/Console/Command/ProcessCommand.php +++ b/src/Console/Command/ProcessCommand.php @@ -82,6 +82,15 @@ protected function configure(): void protected function execute(InputInterface $input, OutputInterface $output): int { + // "-n" is the "--dry-run" shortcut here, but means "--no-interaction" in most CLI tools; + // warn and steer to the explicit flag, to be removed in the next major version + if ($input->hasParameterOption('-n', true)) { + $this->symfonyStyle->getErrorStyle() + ->warning( + 'The "-n" shortcut for "--dry-run" is deprecated and will be removed, as it means "--no-interaction" in most CLI tools. Use "--dry-run" instead.' + ); + } + // missing config? add it :) if (! $this->configInitializer->areSomeRectorsLoaded()) { $this->configInitializer->createConfig(getcwd());