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

Display summary text for all the subcommands for top level --help option #90

Closed
kpritam opened this issue May 15, 2021 · 7 comments · Fixed by #91
Closed

Display summary text for all the subcommands for top level --help option #90

kpritam opened this issue May 15, 2021 · 7 comments · Fixed by #91

Comments

@kpritam
Copy link

kpritam commented May 15, 2021

Currently running app --help just prints name of the commands but it would be nice if it also prints Summary or Header information along with the name similar to following git --help command

image

@jgoday
Copy link
Contributor

jgoday commented Jun 1, 2021

@kpritam I have tried to implement this in #91.

Could it be a valid solution?

@kpritam
Copy link
Author

kpritam commented Jun 2, 2021

@jgoday Nice to see your PR.
I see you are printing complete help i.e. help for nested options as well.

But if you look at git cli, when you say git --help, it does not print nested options. It only prints top level command names and their description.

To see individual help, one need to run for example, git pull --help command.

@jgoday
Copy link
Contributor

jgoday commented Jun 2, 2021

@kpritam should be fixed now then.
It looks like this
image

@kpritam
Copy link
Author

kpritam commented Jun 2, 2021

@jgoday I have not tested it but your last screenshot is what I was looking for. 🎉
Maybe it is good to align command name and its description in single line.

@jgoday
Copy link
Contributor

jgoday commented Jun 2, 2021

@kpritam If we want to display the subcommand name and the description in one line,
we have to decompose the description helpDoc and get his span text to append it with the name.

It would look like the following image

image

@kitlangton
Copy link
Member

I actually don't mind the description on another line :)
By the by, I've updated the library to the newest version of ZIO and would like to help get it ready for primetime. Let me know if there's anything I can help with :)

@jgoday
Copy link
Contributor

jgoday commented Aug 31, 2021

I actually don't mind the description on another line :)
By the by, I've updated the library to the newest version of ZIO and would like to help get it ready for primetime. Let me know if there's anything I can help with :)

I just updated the branch with the changes from zio-cli / master, updated the git example too (to include subcommands help).
Let me know if it's ok :)

Thanks.

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 a pull request may close this issue.

3 participants