-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to group commands in help message #836
Comments
also interested if this is possible |
also interested |
+1 |
Just came across https://github.com/google/kf/issues/55 and there's a link to a comment explaining how it can be done, see https://github.com/google/kf/issues/55#issuecomment-493706608. I haven't tried it yet. That said, google/kf#130 is an example PR of how that approach could be used |
I think this is a great addition and has obvious use cases. I will target to get this in a future release after 1.0.0. |
related to #682 |
This issue is being marked as stale due to a long period of inactivity |
Not stale |
Before I wrote a golang debugger, I need this feature, too. Though it's not as convenient as we expected, but indeed cobra provides the basic support for this. As we all know, a debugger may support breakpoints, list source, print variables and types, so I think it's better to group the commands by category of functions. You can reference the code here, https://sourcegraph.com/github.com/hitzhangjie/godbg@915799c5979b00699729d318ec1226cd75e9f372/-/blob/cmd/debug/shell.go#L143 To summarize the code:
To write several lines of code is enough, and you can check the following picture to see whether this manner meet your needs: |
pre-emptive not-stale |
Wondering if:
cmd.SetHelpCommand(cmd *Command)
We don't have to group all commands. Maybe just the root command. A good example
The text was updated successfully, but these errors were encountered: