I would like to achieve the following behavior in argparse
pro [-a xxx | [-b yyy -c zzz]] -d uuu -e vvv -f www
This is an extension to the problem in "Python argparse mutual exclusive group" which recommends using subparsers.
But in this case, creating two subparsers to make the set of arguments -a
and set -b
and -c
exclusive means duplicating -d
, -e
, -f
in each subparser.
Is there another way to do this within argparse
? Or the checks will have to be done manually?