Skip to content

fix: enforce require_subcommand maximum for dot notation - #1384

Merged
henryiii merged 1 commit into
mainfrom
fix/dot-notation-subcommand-max
Jul 29, 2026
Merged

henryiii merged 1 commit into
mainfrom
fix/dot-notation-subcommand-max

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

The dot-notation path in App::_parse_arg called _find_subcommand directly, which skipped the require_subcommand maximum check that _valid_subcommand does for the usual path. --sub1.value=a --sub2.value=b thus parsed two subcommands when the maximum was 1.

The dot-notation branch now rejects the match when the maximum is reached and the subcommand is not already parsed. Repeated options on one already-parsed subcommand still work. Silent subcommands are not affected, because they do not count toward the maximum in either path.

Fixes #1383

The dot-notation path in `App::_parse_arg` called `_find_subcommand`
directly, so it started a new subcommand even when the maximum count was
reached. Options for a subcommand that is already parsed are still
allowed.

Fixes #1383

Assisted-by: ClaudeCode:claude-opus-5
@henryiii
henryiii merged commit 18b2e52 into main Jul 29, 2026
73 checks passed
@henryiii
henryiii deleted the fix/dot-notation-subcommand-max branch July 29, 2026 20:14
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.

Dot notation bypasses require_subcommand maximum

1 participant