feat: add PrefixCommandMode::PositionalOnly (#1374) - #1382
Conversation
|
@phlptp thoughts? This was changed in 2.6.2. We could introduce a new mode for the strict stop at any option mode. Or we could reintroduce the old mode, though that's more churn since this has only been out in one patch release. (This PR is just the revert, but any path is possible) |
|
the |
Keep the 2.6.2 behavior for prefix_command(true): parsing stops at the first unrecognized item. Add a new PrefixCommandMode::PositionalOnly that only stops at the first positional argument or the -- separator; unrecognized options are collected as extras and parsing continues. This gives the pre-2.6.2 behavior as an opt-in mode. Assisted-by: ClaudeCode:claude-fable-5
a804093 to
29832c7
Compare
|
Ahh, I wish it wouldn't auto-push. I'll comment or undraft when happy with it. Edit: looks pretty good, ready for review. 🤖 AI text below 🤖 Reworked as suggested: the revert is dropped, |
🤖 AI text below 🤖
Fixes #1374.
Reworked per review: instead of reverting the 2.6.2 behavior, this keeps
prefix_command(true)(PrefixCommandMode::On) as is — parsing stops at the first unrecognized item — and adds a newPrefixCommandMode::PositionalOnly.In
PositionalOnlymode, only a positional argument or the--separator triggers prefix mode; an unrecognized option is collected as an extra and parsing continues. This is the pre-2.6.2 behavior as an opt-in mode, which is what ParaView/VTK depended on (they can switch toprefix_command(CLI::PrefixCommandMode::PositionalOnly)).Includes tests for the new mode and README/docstring updates.