fix: prefix_command should not stop parsing at unrecognized options (#1374)#1382
fix: prefix_command should not stop parsing at unrecognized options (#1374)#1382henryiii wants to merge 1 commit into
Conversation
…1374) In 2.6.2 (#1266), prefix_command(true) began sweeping all remaining tokens into extras on the first unrecognized option, silently dropping registered options that appeared after it. This restores the pre-2.6.2 behavior: only a positional argument or the `--` separator stops parsing; unrecognized options are collected as extras and parsing continues. The SeparatorOnly mode added in #1266 already covers the strict use case from #1264 and is unchanged. Assisted-by: ClaudeCode:claude-opus-4.8
|
@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 |
🤖 AI text below 🤖
Fixes #1374.
prefix_command(true)changed behavior between 2.5.0 and 2.6.2. Since #1266 (2.6.2), the first unrecognized option caused all remaining tokens — including registered options — to be swept into extras, so whether a registered option was recognized depended on its position relative to unknown ones. This broke ParaView/VTK, which usesprefix_command+allow_extrasto pick out the handful of options registered so far, wherever they appear, before a later re-parse.This restores the long-standing behavior: only a positional argument or the
--separator stops parsing; an unrecognized option is collected as an extra and parsing continues.The
SeparatorOnlymode added in #1266 already covers the strict case from #1264 and is unchanged. Theprefix_commanddocstring, which incorrectly claimed parsing stopped at the first unrecognized option, is corrected.A regression test covering the issue's order-independence scenario was added, and the one existing assertion that had locked in the 2.6.2 behavior was updated.