Repository navigation
ux: group bare winuxcmd output into coreutils-style sections + i18n locale hint (#1155) - #1160
Merged
Merged
Conversation
…n locale hint (issue #1155) Bare 'winuxcmd' printed 193 lines of registration-ordered command summaries with no structure and no discovery guidance. Rework it: - Group all registered commands into nine GNU coreutils-style sections (File operations, Text processing, Compare & patch, Numeric operations, Search tools, Checksums & encoding, Shell utilities, System & process, Terminal & documentation), alphabetical inside each section; uncategorized commands would fall into an 'Other utilities' catch-all so new commands stay visible. - Print a discovery guide before the groups: 'winuxcmd <command> --help', 'winuxcmd help <command>', 'winuxcmd --list-all' and 'wpm search <capability>'. - Add 'winuxcmd --list-all' for the flat alphabetical listing. - Detect the system locale with an injection-friendly precedence (WINUX_LANG > LC_ALL > LC_MESSAGES > LANG > GetUserDefaultLocaleName) and, when it is non-English and the matching WPM i18n catalog (#1151) is not installed, print one hint pointing at 'wpm install winuxcmd-i18n-zh-cn' + WINUX_LANG=zh-CN. English locales, explicit WINUX_LANG=off and installed catalogs stay silent. Command parsing and dispatch are untouched; all 178 registered commands still dispatch (per-command --version loop green) and the winuxcmd unit group passes 36/36, including new tests for section grouping, alphabetical order, bare-vs-list-all parity, and the four locale-hint states.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bare
winuxcmdprinted 193 lines of registration-ordered command summaries (issue #1155). This PR restructures the bare output around GNU coreutils-style presentation groups and adds i18n discoverability.Grouped bare output
winuxcmd <command> --help,winuxcmd help <command>,winuxcmd --list-all,wpm search <capability>.winuxcmd --list-allkeeps the flat alphabetical listing for scripts and users who prefer it.i18n / locale hint (#1151)
winux::i18n::system_locale()resolves the effective locale with an injection-friendly precedence:WINUX_LANG→LC_ALL→LC_MESSAGES→LANG→GetUserDefaultLocaleName, normalizingzh_CN.UTF-8-style values tozh-CN.Tip: Chinese help is available - run 'wpm install winuxcmd-i18n-zh-cn' and set WINUX_LANG=zh-CN to enable it.WINUX_LANG=off(explicit opt-out), or the catalog for the locale (including bare-language fallback) is already installed under.wpm/i18n/.Compatibility
--versionloop over all 178 registered commands passes (0 fails, 0 timeouts) and the full unit suite is green apart from two pre-existing environment failures (grepsymlink fixtures require symlink privilege, unrelated to this change).Test plan
winuxcmd.*unit group: 36/36 passed, including 8 new tests — section grouping, alphabetical order inside sections, bare-vs---list-allcommand-set parity, flat listing shape, and the four locale-hint states (zh without catalog → hint;LANG=zh_CN.UTF-8injection → hint;WINUX_LANG=en→ silent; installed catalog → silent, help stays English / localized whenWINUX_LANG=zh-CN).grepfixtures (test-fixturecreate_directory_symlinkneeds elevation; fails before any dispatch).scripts/format.sh); regenerated English catalog confirms all 16 newmain.*keys are extractable (added toMANUAL_MESSAGESwhere helper-indirected).Notes for reviewers
main.category.*/main.guide.*/main.i18n_hintkeys should be added inunixwin/winuxcmd-i18n(with the mandatoryVERSIONbump) — the English fallbacks in this PR render fine meanwhile; missing keys fall back to English.kLocalePackageHintsinsrc/utils/i18n.cppm.Closes #1155