I have a function to conduct the argument parsing for my program, let's say I have
def parse_program_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--A",
type='str'
)
parser.add_argument(
"--B",
type='str'
)
parser.add_argument(
"--C",
type=int
)
...
...
A
can have one of a few options as well as B and C (each of them has another set of optional values).
I'm trying to manage restriction on the user choices and mutual exclude some values for those arguments.
For example, I want to ban the following combinations of arguments:
--A apple" and "--B red
--B red --C 1
The problem is that I don't want to impose an order restriction on the user, so I can't rely on the argument order. I'm looking for a pythonic way to do so.