You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[dispatcher] Abbreviation/help interception is arity- and boundary-blind: option values and wrapped commands' args get intercepted #1303
The dispatcher's pre-parse passes (long-option abbreviation expansion and --help/--version interception) scan every--xxx token without tracking option arity or command structure. Two observable consequences:
Option values that look like options are intercepted/expanded.
grep --label --help -e x f — GNU treats --help as the label value and searches. WinuxCmd prints grep's own help and never searches (probe: stdout = grep usage text, rc0).
cp --suffix --ver a b — GNU copies with suffix value --ver. WinuxCmd: cp: option '--ver' is ambiguous; possibilities: '--verbose' '--version' + Try, exit 1, nothing copied.
Wrapped commands' arguments are intercepted (dispatcher doesn't stop at the wrapped-command boundary).
printf 'a\n' | xargs echo --help — GNU runs echo, stdout --help a. WinuxCmd prints xargs' help; the command never executes.
Same shape expected for find . -exec echo --help \;, timeout 5 echo --help, env echo --version (xargs form probe-verified; the layer is shared).
Source
src/core/dispatcher.cppm: abbreviation normalization (~L1063-1145) and help/version scan (~L1158-1210) walk tokens linearly; only -- stops them. The per-command policy that does know the boundary (command_context.cppmstop_options_after_positionals, e.g. xargs) runs later, inside the handler — too late. Contrast: value consumption in the real parser (opt.cppm) is arity-aware; the dispatcher pre-passes are not.
Regression seed
grep --label --help -e x f (f contains x) → expect the matching line, rc0.
cp --suffix --ver a b → expect copy created, rc0, no stdout.
Verified fixed on current main (the parser/dispatcher alignment landed with #1391):
grep --label --help -e x treats --help as the label value and searches (probe: prints the matching line, rc0).
printf 'a\n' | xargs echo --help runs echo with --help a (rc0) — the wrapped-command boundary is honored; the env/timeout faces carry their own pins (env_wrapped_command_version_is_not_intercepted, timeout_wrapped_command_help_is_not_intercepted).
cp --suffix --ver a b no longer trips the abbreviation expander (value tokens are arity-aware).
Closing with these probe results on the current build.
Activity
caomengxuan666 commentedon Oct 27, 2026
Verified fixed on current main (the parser/dispatcher alignment landed with #1391):
grep --label --help -e xtreats --help as the label value and searches (probe: prints the matching line, rc0).printf 'a\n' | xargs echo --helpruns echo with--help a(rc0) — the wrapped-command boundary is honored; the env/timeout faces carry their own pins (env_wrapped_command_version_is_not_intercepted,timeout_wrapped_command_help_is_not_intercepted).cp --suffix --ver a bno longer trips the abbreviation expander (value tokens are arity-aware).Closing with these probe results on the current build.
tests: lead PATH with the staged bin dir in env's wrapped-version test
fix(dispatcher): verb-form --version scan follows the per-command rule
packaging: 1.2.0 multicall edition split (default vs full) (#1438) (#…
fix(find): register --help/--version as synonyms acting where they ap…
fix(batch): timeout chained-shebang pin (#1595), run-gate.sh on CI (#…