diff --git a/legacy/src/Command/RuntimeOperation/RunCommand.php b/legacy/src/Command/RuntimeOperation/RunCommand.php index 08495c37a..3c1360b42 100644 --- a/legacy/src/Command/RuntimeOperation/RunCommand.php +++ b/legacy/src/Command/RuntimeOperation/RunCommand.php @@ -4,6 +4,7 @@ namespace Platformsh\Cli\Command\RuntimeOperation; +use Platformsh\Cli\Console\ArrayArgument; use Platformsh\Cli\Selector\Selector; use Platformsh\Cli\Selector\SelectorConfig; use Platformsh\Cli\Service\ActivityMonitor; @@ -39,7 +40,9 @@ protected function configure(): void $this->selector->addAppOption($this->getDefinition()); $this->addCompleter($this->selector); $this->addOption('worker', null, InputOption::VALUE_REQUIRED, 'A worker name'); + $this->addOption('parameter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A parameter for the operation. ' . ArrayArgument::SPLIT_HELP); $this->activityMonitor->addWaitOptions($this->getDefinition()); + $this->addExample('Run the "clear-cache" operation with parameters', 'clear-cache --app myapp --parameter param1 --parameter param2'); } protected function execute(InputInterface $input, OutputInterface $output): int @@ -123,7 +126,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int } try { - $result = $deployment->execRuntimeOperation($operationName, $appName); + $parameters = ArrayArgument::getOption($input, 'parameter'); + $result = $deployment->execRuntimeOperation($operationName, $appName, $parameters); } catch (OperationUnavailableException) { throw new ApiFeatureMissingException('This project does not support runtime operations.'); }