diff --git a/src/Command/RequireCommand.php b/src/Command/RequireCommand.php index d437b312f..e54798838 100644 --- a/src/Command/RequireCommand.php +++ b/src/Command/RequireCommand.php @@ -32,19 +32,19 @@ public function __construct(PackageResolver $resolver) protected function configure() { parent::configure(); - $this->addOption('unpack', null, InputOption::VALUE_NONE, 'Unpack Symfony packs in composer.json.'); + $this->addOption('no-unpack', null, InputOption::VALUE_NONE, 'Disable unpacking Symfony packs in composer.json.'); + $this->addOption('unpack', null, InputOption::VALUE_NONE, '[DEPRECATED] Unpacking is now enabled by default.'); } protected function execute(InputInterface $input, OutputInterface $output) { - $unpack = $input->getOption('unpack'); + if ($input->getOption('unpack')) { + $this->getIO()->writeError('The "--unpack" command line option is deprecated; unpacking is now enabled by default.'); + } + $packages = $this->resolver->resolve($input->getArgument('packages'), true); if ($packages) { $input->setArgument('packages', $this->resolver->resolve($input->getArgument('packages'), true)); - } elseif ($unpack) { - $this->getIO()->writeError('--unpack is incompatible with the interactive mode.'); - - return 1; } if (version_compare('2.0.0', PluginInterface::PLUGIN_API_VERSION, '>') && $input->hasOption('no-suggest')) { @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $ret = parent::execute($input, $output) ?? 0; - if (0 !== $ret || $input->getOption('no-update')) { + if (0 !== $ret || $input->getOption('no-unpack') || $input->getOption('no-update')) { return $ret; }