Cli: Subcommand help is not showing

Created on 29 Jan 2015  Â·  8Comments  Â·  Source: urfave/cli

I seem to never be able to get help to print the subcommand help. Looking at the code, I would expect SubcommandHelpTemplate to be used for this, but it is not used anywhere in the code. If stacks is a command with sub commands, it will print the list of subcommands with a command like this: cli stacks help which uses AppHelpTemplate.

In this case however:

  • Email and Author revert back to unknown and 0.0.0.0 (as if the command is app)
  • There is no way to get the help for a subcommand.
arev2 help wanted kinfeature statuconfirmed statustale

Most helpful comment

I found out that I can get the subcommand help by doing something like cli stacks help subcommand but find this unintuitive. Should not the help be shown by typing the following?

cli help stacks
cli help stacks subcommand

All 8 comments

I found out that I can get the subcommand help by doing something like cli stacks help subcommand but find this unintuitive. Should not the help be shown by typing the following?

cli help stacks
cli help stacks subcommand

I also feel it's unintuitive that the output for cli help stacks subcommand is not the same as cli stacks help subcommand. Also, assuming stacks has subcommands, cli help stacks doesn't mention the fact, but cli stacks help does.

I spent an hour trying to fix this just now but ran into dependency initialisation loops. I'll have another crack at it at a later date probably.

I agree, the same output should be shown for cli help stacks subcommand as cli stacks help subcommand. Thanks for bringing this up!

(Note you can also see it via cli stacks subcommand -h)

I ended up working around this by doing my own global flag parsing, then scanning through looking for any argument called "help". If help, --help or -h were found, then it sticks --help on the end.

I'm no closer to actually fixing the problem though.

In case anyone is interested in fixing this issue, I would love to review a PR for ya! ✨

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

Manually closing this as stale! We can re-open if there's interest in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renzhengeek picture renzhengeek  Â·  5Comments

Zyko0 picture Zyko0  Â·  6Comments

costela picture costela  Â·  5Comments

genieplus picture genieplus  Â·  5Comments

errashe picture errashe  Â·  3Comments