Advertisement
Guest User

Hierarchical argparse: commands in all help messages

a guest
Jul 2nd, 2019
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. >>> parent_parser.print_help()
  2. usage: main.py [-h] -p P {create,update} ...
  3. The parent parser
  4. optional arguments:
  5.   -h, --help       show this help message and exit
  6.   -p P             set db parameter
  7. actions:
  8.   {create,update}
  9.     create         create the orbix environment
  10.     update         update the orbix environment
  11.  
  12.  
  13. >>> parser_create.print_help()
  14. usage: main.py create [-h] -p P [--name NAME] {create,update} ...
  15. The create parser
  16. optional arguments:
  17.   -h, --help       show this help message and exit
  18.   -p P             set db parameter
  19.   --name NAME      name of the environment
  20. actions:
  21.   {create,update}
  22.     create         create the orbix environment
  23.     update         update the orbix environment
  24.  
  25.  
  26. >>> parser_update.print_help()
  27. usage: -c update [-h] -p P {create,update} ...
  28. The update parser
  29. optional arguments:
  30.   -h, --help       show this help message and exit
  31.   -p P             set db parameter
  32.  
  33. actions:
  34.   {create,update}
  35.     create         create the orbix environment
  36.     update         update the orbix environment
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement