1

I have multiple levels of subparsers within subparsers, but when I run the program with help flag, I see help messages and choices only for top level options. How can I see help for all suboptions, or for specific suboption in deeper level?

Euphorbium
  • 1,177
  • 5
  • 17
  • 35

1 Answers1

4

To get the help for a subparser, use a command like python prog.py cmd1 -h. To get the help for a sub-subparser, python prog.py cmd1 cmd12 -h should work.

There isn't a means, with the default help mechanism, to show the help for the main parser and all the subparsers (and sub-subparsers) with one command. It just gets too complicated.

I'd suggest custom usage and description. That includes titles and descriptions for the subparsers, etc.

hpaulj
  • 221,503
  • 14
  • 230
  • 353