Skip to content

[compat] find --help/--version 优先级偏差:预扫描先于表达式解析,错误 + help 组合时 GNU 报错优先(wc-b3 3a76db02 后续) #1633

Closed

Description

@caomengxuan666

跟踪自 find 大件审阅 lane 的跨 lane 发现(rust2/find-impl 审阅,2026-11-14)。

现状:#1617 由 PR #1632 的 3a76db02 修复,修法是 act-immediately 预扫描(在表达式解析前扫描 help/version 拼法)。对 #1617 报告的裸拼法与出现位置生效两态正确。

与 GNU 的偏差(错误优先级):GNU findutils 4.9 把 --help/--version 注册在谓词表里、按表达式顺序解析——遇到未知谓词先报错:

GNU 4.9:  find . -foo --version   -> find: unknown predicate '-foo', rc 1
预扫描:    find . -foo --version   -> 打印 version, rc 0(-foo 未被解析到)

同理 -name -help:GNU/Rust 把 -help 当 pattern 操作数,预扫描会触发 help(3a76db02 的 commit message 已如实标注该 edge "kept as-is")。

裁定:rust2/find-impl 的 find 谓词表顺序解析是权威语义(fd001-fd005 strict 全绿 + 探针 P3);C++ 预扫描偏差在 find 接线删除 C++ 体后自然消失。本 issue 用于:

  1. 在 find wire 前钉住该差异(验收时以 rust2 语义为准的对照行)
  2. 若 find wire 长期不落地,回补 C++ 预扫描的顺序化(act-immediately 循环改为表达式解析中触发)

证据:rust2/find-impl 审阅报告 §二;探针存档 rust2/gate/scratch/find-review/probe{1,2}.sh(WSL findutils 4.9.0);gate fd001-fd005。

Activity

  1. added
    bug
    compat-gap
    on Nov 14, 2026
  2. caomengxuan666 commented on Nov 14, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by #1696 (find wire): the rust2 parser owns --help/-help/--version/-version placement; GNU 4.9 order verified in the PR (gate 317/317, ctest 158/158).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions