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

Introduce --help support for all subcommands (recursively) #52

Closed
jdegoes opened this issue Nov 21, 2020 · 1 comment
Closed

Introduce --help support for all subcommands (recursively) #52

jdegoes opened this issue Nov 21, 2020 · 1 comment

Comments

@jdegoes
Copy link
Member

jdegoes commented Nov 21, 2020

Currently, --help is only available for the top-level command. This is inconvenient, because we have full documentation for all subcommands. Yet, at the same time, we cannot display all documentation on a single page. We should wait until the user requests help for a subcommand to print the help.

Thus, our subcommand help can work a bit like git:

git fetch --help

Now, in order to make this work, we need to take care of a few details:

  1. First, the way subcommand help is printed out will be somewhat different from the way the top-level command is printed out. We should look to git and other complicated CLI tools for inspiration.
  2. Second, we need to ensure we can print out help even if a parent command does not have all of its required options and arguments. If we were to do a simple process of augmenting the child commands with --help, then we would only succeed in parsing them if the parents succeeded too. But for help, we really want to ignore required arguments/options for parents, and give the user help anyway. We need to make sure this is possible.
  3. Third, we need to ensure the way it is rendered looks good for commands with subcommands, both the top-level help, as well as the subcommand help, and that it scales for subcommands of subcommands of subcommands (etc.).
@hollinwilkins
Copy link
Contributor

Happy to take a look at this one

@jdegoes jdegoes closed this as completed Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants