Python argparse mutual exclusive group
add_mutually_exclusive_group doesn’t make an entire group mutually exclusive. It makes options within the group mutually exclusive. What you’re looking for is subcommands. Instead of prog [ -a xxxx | [-b yyy -c zzz]], you’d have: prog command 1 -a: … command 2 -b: … -c: … To invoke with the first set of arguments: prog … Read more