Skip to content

hostid: -h must be an invalid option (rc 1), like -v/-V — ho12 sibling gap #1802

Closed

Description

@caomengxuan666

Follow-up to #1800 (ho13). The same anchor governs the sibling row.

GNU 9.4 oracle:

  • hostid -h → hostid: invalid option -- 'h' + try-help, rc 1
  • hostid -x → same shape, rc 1
  • hostid --help / hostid --version → the only accepted spellings (long only)

Why ho13 did not carry it: coreutils src/hostid.c:63-65 delegates to lib/long-options.c:98 parse_gnu_standard_options_only, which has an EMPTY optstring — so -h is not a help alias, it is getopt's invalid option. Making -h correct also means wiring the --help/--version TEXT surface (ho12), which is a separate behavior family: keeping it out of ho13 keeps that PR one-row/one-family reviewable.

Scope for the follow-up lane:

  1. Reject -h (and any single-letter flag) with the invalid-option usage error + rc 1.
  2. Wire --help / --version text bodies (ho12 record-only debt, HELP-SURFACE ledger).
  3. Both rust2 (winux-cmds/src/hostid.rs) and confirm the C++ leg agrees (win-mode gate compares the two Windows legs).

Acceptance: gate rows ho12/ho13 both green; rust2 hostid tests cover -h reject + the two long-option texts; oracle probes above byte-match.

Activity

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

    @caomengxuan666
    MemberAuthor

    队长派修复车道开工(2026-11-16 20:5x CST)。前置 #1800 已合入(5d084695),文件面已空出。修法走 X299-2607 主路线;GNU 锚点 hostid.c:63-65 → long-options.c:98(空 optstring,-h 为 getopt invalid option)。工作区 ~/workspace/fix-winx-1802/,第一个提交即 push + 开草稿 PR。

  3. caomengxuan666 commented on Nov 16, 2026

    @caomengxuan666
    MemberAuthor

    Closed by #1805 (merge 49d22e6, captain-merged 2026-11-16 23:57 CST). Fix: hostid -h is now invalid option rc 1 (argopt H_REJECT_SPEC), --help/--version print GNU 9.4 text (hostid.c:63-65 / long-options.c:98). X299 legs: rust pins 8/8, fail-first 5/3, lib 1023/1023, ctest hostid 4/4, 18/18 probes match GNU, byte-compare rust all-match (cpp --help/--version brand text by design). CI run 43874962136: only the baseline process-shard cell xargs/xa137-signal-death (r_rc=123 c_rc=125) + rust2-gate aggregator red; all else pass. Follow-up: HELP-SURFACE.md / NOTE-QC.md refresh awaits a WSL gate regen (generated files, not hand-edited).

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