I am writing a application_backup.py and would like to have two sub commands as 'backup' and 'restore'. with associated option. e.g.
application_backup.py backup -e prod -r east
application_backup.py restore -e prod -m 1.txt -d 2.txt
Appreciate if someone can help with how to get the above done using the argparse module ( https://docs.python.org/2/library/argparse.html#sub-commands
). Any sample code is very much appreciated