Skip to content

fix: support bundled global options before subcommands#838

Closed
jpravetz wants to merge 2 commits into
c4spar:mainfrom
jpravetz:fix-bundled-options-before-subcommand
Closed

fix: support bundled global options before subcommands#838
jpravetz wants to merge 2 commits into
c4spar:mainfrom
jpravetz:fix-bundled-options-before-subcommand

Conversation

@jpravetz
Copy link
Copy Markdown

Description

Fixes bundled global options before subcommands (e.g., app -SA subcommand).

Problem

  • app -SA subcommand failed when S and A are global options
  • Subcommand detection happened before bundled flags were split

Solution

  • Split bundled flags before subcommand detection
  • Validate bundled flags before subcommands are all global
  • Clear error message for mixed global/non-global bundled flags

Testing

  • Added comprehensive test cases
  • All existing tests pass

NOTE: The fix and unit tests are generated using AI. Assuming you don't already know about this bug, and If you wish to incorporate this fix, you will need to do a code review of the fix.

- Split bundled flags before subcommand detection
- Validate that bundled flags before subcommands are all global
- Add comprehensive tests for bundled options scenarios

Fixes issue where 'app -SA subcommand' would fail when S and A are global options
@c4spar c4spar closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants