I know that it can be solved by if - else
statement, my question is about native argparse support for this issue.
Let's say my script have two flags:
--nocreate
and --rehydrate
--rehydrate
flag is only valid if --nocreate
flag exists
So
my_script.py --nocreate
- valid
my_script.py --nocreate --rehydrate
- valid
my_script.py --rehydrate
- error, missing --nocreate
flag
Thanks