Skip to content

refactor(#585): the invocation-aware help/version surface moves to the lib - #606

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/585-host-half-usage-lib
Oct 14, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/585-host-half-usage-lib

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Owner hit the host half of #585 live: the installed shell's bash shim reaches niu.exe (the launcher), whose parser printed the product help under bash --help - the rubash#596 fork lived in this crate's bin target where the launcher can't reach it.

rubash::usage now owns the contract (invocation_help_name / show_shell_help / show_shell_version / the LONG_OPTIONS tables). The engine binary calls the same functions; issue585_invocation_aware_help_regressions passes 4/4 unchanged (byte contracts intact). No behavior change for current callers - this is the export the niu host half needs (niubash PR follows once this merges).

…e lib

The bash/sh fork (rubash#596) lived in this crate's bin target, so the
niu launcher - which embeds the engine as a library - kept answering
'bash --help' with the product help (owner report 2026-10-14: the
installed shell's bash shim reaches niu.exe, whose launcher parser
never saw the fork).

rubash::usage now owns the contract: invocation_help_name,
show_shell_help, show_shell_version, and the LONG_OPTIONS tables the
argv parser and the usage block share. The engine binary calls the same
functions (the #585 byte-contract regressions pass unchanged); the
version line falls back to the executor's advertised BASH_VERSION
value when the caller has no executor. No behavior change for any
current caller - this is the export the niu host-half needs.
@caomengxuan666
caomengxuan666 merged commit e785c3c into master Oct 14, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/585-host-half-usage-lib branch October 14, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant