Skip to content

complete -D -F name → usage error rc 2 (GNU is silent rc 0) #133

Closed

Description

@caomengxuan666

Found by the machine corpus scan (bash completion loaders call complete -D -F _completion_loader).

GNU bash 5.3: accepts -D (default completion) silently, rc 0 — builtins/complete.def supports -DEI. Rubash: prints a usage error naming -DEI in the usage line itself, rc 2.

Artifacts: target/gc/corpus-agent/analysis.txt (F5, reproducer min-complete.sh).

Activity

  1. added
    bug
    on Sep 26, 2026
  2. caomengxuan666 commented on Sep 26, 2026

    @caomengxuan666
    MemberAuthor

    已在 e63f2d43(随 096a839 推送)修复并关闭。

    根因:usage 门只测 operands.is_empty() && opt_given,而 GNU complete_builtin(builtins/complete.def:417-424)把 -D/-E/-I 变成伪名 word list(pcomplete.h:109-111 _DefaultCmD_ 等),usage 条件(complete.def:460-464)里伪名算名字。修复:门条件加 && pseudo.is_none(),落入既有伪名注册路径。

    验证:-D/-E/-I 三形态 rc 0 静默、complete -p -E/-I/-D 输出与 GNU 同形;bash_completion:3617 的动态默认补全注册成功——合并后 master 上 bash-completion 全量加载 rc 0,注册 131 = GNU 144 − 13 条 WSL 环境项,机制面齐平。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions