-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 help for all subcommands at the same time #1334
Comments
Do you have examples of commands that do that today? I'm having a hard time picturing this not being overwhelming. |
I would have examples if clap supported it. Command line applications don't always have 100s of options. Underwhelming is how I'd describe the current usefulness of the help info generated right now. |
Would be much more useful combined. |
|
I was hoping for precedent from another CLI to take inspiration from and to see how well it works in practice @mkayaalp I see that opkg shows subcommand usage. Is that your proposal for this? Looks similar to #962 |
|
@dpc mind hacking up example output of what your ideal would look like with |
No strong opinions, but seems to me like just expanding every subcommand under |
With clap, we are trying to balance ease of use, flexibility, and compile-time / binary size. We have plans for decoupling help generation, allowing custom formatting. I have a feeling that this might be the best way forward for this. We wouldn't have a built-in "show all subcommands" flag but give you the tools to auto-generate the help output to look like you want it to. I'm going to mark this issue as blocked on #2914 to make sure we track the requirements needed for this and I'm assuming we will close this out when #2914 is resolved. If there are concerns about this plan, let us know! |
Been thinking on this as we've been iterating on #3174. I realized there is a good template for us to use for this, |
One idea I was toying with Setting:
Help output:
Man page:
Open question:
|
Anyone have thoughts on how to refer to / what to call the difference in subcommands between |
decoupled/coupled subcommand help maybe? Assuming you want to mention all the subcommand in the same |
Would love feedback on #5206 |
Maintainer's note: Proposed solution
Setting:
help_includes_subcommands
orhelp_shows_subcommands
flatten_subcommands_in_help
subcommand
because this is set on the parent of the subcommands rather than a subcommand itselfHelp output:
help_includes_subcommands
set (this diverges fromgit stash <command> -h
which showsgit stash -h
)Man page:
Open question:
Implementation:
The API is very large and I've struggled to find any examples or hints pointing to this possibility. Is it possible for the help page for a program to list the help pages of all subcommands at the same time, rather than just the current scope? That way the user does not need to also request for the help info from each subcommand.
The text was updated successfully, but these errors were encountered: