Repository navigation
fix(command): treat subcommands of hidden commands as hidden recursively - #2463
AdamMagued wants to merge 3 commits into
Conversation
|
| func buildShellCompletionSubcommand(shell string, render renderCompletion, appName string) *Command { | ||
| return &Command{ | ||
| Name: shell, | ||
| Hidden: true, |
There was a problem hiding this comment.
Public completion loses shell choices
Setting cmd.Hidden = false in ConfigureShellCompletionCommand no longer makes the completion shells visible. Each shell now has its own Hidden: true, so help and shell suggestions omit bash, zsh, fish, and pwsh even when their parent is public. Users can still run them by typing the full command.
Leave the shells visible by default and let isHidden() inherit their parent's visibility. Add a test for the documented customization.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Removed explicit Hidden: true on individual shell completion subcommands so their visibility dynamically inherits from the parent completion command via isHidden(). Added unit tests covering shell subcommand visibility in help output, shell suggestions, and dynamic customization when the completion command is made public.
Signed-off-by: AdamMagued <adamismailmageud@gmail.com>
6b28aeb to
4719b91
Compare
Fixes #2372
Summary
Hidden: true.Verified via container sandbox test suite.