0

I want to modify the -h in order to display optional parameters even when the subparser is not specified.

It seems that by default -h displays information only for the main parser and in order to display the ones specific for each subparser I need to call script.py xxx -h where xxx is the subparser.

sorin
  • 161,544
  • 178
  • 535
  • 806
  • possible duplicate of [argparse subparser monolithic help output](http://stackoverflow.com/questions/20094215/argparse-subparser-monolithic-help-output) – wap26 Sep 16 '15 at 12:02
  • There isn't a builtin mechanism. The main parser displays what it knows, the subparsers what they know. So you have to collect the information yourself. Do you want to do it in a superficial way, or are you willing to get into the guts of `argparse`? – hpaulj Sep 16 '15 at 16:13
  • http://stackoverflow.com/questions/32581439/subparser-show-help-for-both-parser-and-subparser is a similar recent question. – hpaulj Sep 16 '15 at 16:37
  • If previous answers are inadequate, you need to give an example with desired output. There are too many ways of displaying this information to give simple general solution. – hpaulj Sep 16 '15 at 17:24

0 Answers0