Skip to content

Honor persistent flags in proxy commands#274

Merged
gtsiolis merged 1 commit into
mainfrom
honor-persistent-flags-in-proxy-commands
Jun 2, 2026
Merged

Honor persistent flags in proxy commands#274
gtsiolis merged 1 commit into
mainfrom
honor-persistent-flags-in-proxy-commands

Conversation

@gtsiolis
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis commented Jun 1, 2026

Generalizes #273. Proxy commands set DisableFlagParsing, so lstk's persistent flags were forwarded to the wrapped binary (rejected as unknown options) and their effect silently dropped. --config is broken on lstk aws the same way --non-interactive was — it's ignored and passed through to aws.

Changes

  • Add stripGlobalFlags, which extracts --non-interactive and --config (both --flag value and --flag=value, in any position) from a proxy command's args. Reusable by future proxy commands; replaces the one-off stripNonInteractiveFlag.
  • lstk aws now sets cfg.NonInteractive so interactivity is consistent across the codebase, and routes --config back through Cobra so initConfig resolves the overridden path instead of forwarding it to aws.

Tests

  • Unit TestStripGlobalFlags (both flags, both forms, interleaving, edge cases).
  • Integration TestAWSCommandStripsGlobalFlagsFromPassthrough — asserts both flags are consumed by lstk, not forwarded to the aws binary.

🤖 Generated with Claude Code

@gtsiolis gtsiolis force-pushed the honor-persistent-flags-in-proxy-commands branch from 7c62d39 to 47b9d1c Compare June 1, 2026 18:42
@gtsiolis gtsiolis changed the title Honor lstk's persistent flags in proxy commands Honor persistent flags in proxy commands Jun 1, 2026
@gtsiolis
Copy link
Copy Markdown
Member Author

gtsiolis commented Jun 1, 2026

Follow up from #273 (review). Cc @carole-lavillonniere

Possibly worth waiting for #251 to land first.

@gtsiolis gtsiolis merged commit e9f6fcc into main Jun 2, 2026
12 of 13 checks passed
@gtsiolis gtsiolis deleted the honor-persistent-flags-in-proxy-commands branch June 2, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants