Skip to content

fix: hide internal alias flags from help output#5025

Open
immanuwell wants to merge 1 commit into
containerd:mainfrom
immanuwell:fix/help-alias-flags
Open

fix: hide internal alias flags from help output#5025
immanuwell wants to merge 1 commit into
containerd:mainfrom
immanuwell:fix/help-alias-flags

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

small help output papercut.

right now nerdctl --help shows internal alias shim flags like -a, --a, -H, --H, -n, --n. same thing in nerdctl compose --help with -f, --f. looks a bit weird, and not really what users should see.

this hides those shim flags from help, and shows aliases on the real flag line instead. alias parsing still works, so no behavior change there.

repro

go build ./cmd/nerdctl
./nerdctl --help
./nerdctl compose --help

before

-a, --a string
-H, --H string
-n, --n string
-f, --f stringArray

after

--address string ... (aliases: -a, -H, --host)
--namespace string ... (aliases: -n)
--file stringArray ... (aliases: -f)

checks

go test ./cmd/nerdctl -run 'TestRootHelpHidesAliasImplementationFlags|TestRootHiddenAliasesStillParse'
go test ./cmd/nerdctl/compose -run 'TestComposeHelpHidesAliasImplementationFlags|TestComposeHiddenFileAliasStillParses'

Signed-off-by: immanuwell <pchpr.00@list.ru>
@AkihiroSuda AkihiroSuda added this to the v2.4.0 milestone Jul 9, 2026
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.

2 participants