Skip to content
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

Allowing display of root commands in sections #682

Closed
odinath opened this issue Apr 20, 2018 · 5 comments
Closed

Allowing display of root commands in sections #682

odinath opened this issue Apr 20, 2018 · 5 comments

Comments

@odinath
Copy link

odinath commented Apr 20, 2018

Hi folks and thanks for Cobra!

I'm using your library to create a plugin to Cloud Foundry. Its help output is displaying all root commands organized within sections. See the following example below:

image

To ease the plugin adoption and to ensure a proper user experience, I'm trying my best to get my Cobra-based help output aligned with the one of Cloud Foundry.

I was wondering if Cobra is currently allowing for such an organization, where root commands can be gathered and displayed within main sections? If not, is it part of your roadmap?

Thanks for your reply.

@odinath
Copy link
Author

odinath commented Apr 23, 2018

Seems the library already provides such a feature through 'annotations':

image

Could you please confirm and provide examples on how to proceed?

@ghostsquad
Copy link

I'm also curious how this works. I'm not sure how you use the annotations to group commands.

@github-actions
Copy link

github-actions bot commented Jun 3, 2020

This issue is being marked as stale due to a long period of inactivity

@ghostsquad
Copy link

Not stale

@johnSchnake
Copy link
Collaborator

Agree that annotations is confusing at best; it seems like maybe that functionality was removed? There isn't any use of it in the code but you could concievably but data in there and write your own custom usage func which would loop over the data and print what you need.

#836 is asking the same thing though and has more discussion to follow there.

Closing as duplicate.

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

No branches or pull requests

3 participants