Skip to content

Commit 1f02d34

Browse files
jszobodyclaudehappy-otter
committed
Fix diff command to use provided stage arguments in shell
The diff command was ignoring positional stage arguments (e.g., "diff staging production") and using the current context stage instead. This made it impossible to compare different stages in the interactive shell. Fixed by adding special handling in KeepProxyCommand for the diff command: - Positional arguments are now treated as stage names - Stages are converted to --stage=stage1,stage2 format - "unmask" is still recognized as a boolean flag Now the shell properly supports: - diff staging production - diff staging production unmask - diff local staging production This matches the documented behavior and user expectations. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent 9bd9621 commit 1f02d34

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/Shell/Commands/KeepProxyCommand.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7777
*/
7878
private function parseNaturalSyntax(array $args, array &$positionalArgs, array &$options): void
7979
{
80+
// Special handling for diff command - positional args are stages
81+
if ($this->keepCommand === 'diff') {
82+
$stages = [];
83+
foreach ($args as $arg) {
84+
if ($arg === 'unmask') {
85+
$options['unmask'] = true;
86+
} else {
87+
// Treat as a stage name
88+
$stages[] = $arg;
89+
}
90+
}
91+
if (!empty($stages)) {
92+
$options['stage'] = implode(',', $stages);
93+
}
94+
return;
95+
}
96+
8097
// Define known option keywords for each command
8198
$knownOptions = [
8299
'show' => [
@@ -92,9 +109,6 @@ private function parseNaturalSyntax(array $args, array &$positionalArgs, array &
92109
'json' => ['format', 'json'],
93110
'table' => ['format', 'table'],
94111
],
95-
'diff' => [
96-
'unmask' => ['unmask', true],
97-
],
98112
'export' => [
99113
'json' => ['format', 'json'],
100114
'env' => ['format', 'env'],

0 commit comments

Comments
 (0)