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
[cli] invocation-name-aware help is forked: bash --help / sh --help print the niu product help instead of the GNU usage contract #585
$ bash --help
GNU bash, version 5.3.0(1)-release-(x86_64-pc-linux-gnu)
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
...
$ sh -c 'echo $?'; echo rc=$?
rc=0
Current (niu hosting the bash invocation name):
$ bash --help
Niubash 1.4.0 — a bash-compatible shell that feels at home on Windows.
Usage: niu [option]
niu -c <cmd> ...
--install-wt-profile ...
plugin add <id|owner/repo|url|path>
...
The fork
#504/#262 forward the sh/bash invocation name for the execution contract, but the help surface never forked: under a bash/sh argv[0] the product help (setup/font/doctor/plugin/self-update — none of which are bash options) is printed, and every GNU shell option (-l -i -r -s -D -O --debug --noprofile --norc --posix --restricted ...) is absent.
Expected
bash --help / sh --help under the respective invocation name print the GNU usage shape (version line + short/long option table), rc 0, to stdout.
niu --help keeps the product help.
The GNU option table should list what the engine actually honors today (login/-i/--posix/--rcfile...), not aspirational entries — mark anything unimplemented explicitly or omit it, per the GNU oracle byte shape where implemented.
Found during the 1.4.0 pre-release install audit (owner-reported on the packaged build).
Owner follow-up on the packaged build: sh --help and bash --help are byte-identical to the niu product help (diff-verified on the installed 1.4.0) — the fork is total, not partial. Constraints from the owner: niu --help KEEPS the full product help (including the Windows-only verbs — install-wt-profile/plugin/self-update); the GNU-usage fork applies only under the bash/sh invocation names; and the fix must not leak Windows-only help assets into the unix cross-compile lanes (keep the product table and the GNU tables behind the same cfg discipline the code already uses).
Activity
caomengxuan666 commentedon Oct 13, 2026
Owner follow-up on the packaged build:
sh --helpandbash --helpare byte-identical to the niu product help (diff-verified on the installed 1.4.0) — the fork is total, not partial. Constraints from the owner:niu --helpKEEPS the full product help (including the Windows-only verbs — install-wt-profile/plugin/self-update); the GNU-usage fork applies only under the bash/sh invocation names; and the fix must not leak Windows-only help assets into the unix cross-compile lanes (keep the product table and the GNU tables behind the same cfg discipline the code already uses).docs(changelog): fold the post-0d99ae2c wave into the 1.4.0 section (#…
Merge pull request #606 from unixwin/fix/585-host-half-usage-lib