Skip to content
Open
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
6 changes: 5 additions & 1 deletion legacy/src/Command/RuntimeOperation/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.');
}
Expand Down
Loading