Here is my code portion:
parser = argparse.ArgumentParser()
parser.add_argument('-a', action='store', dest='xxx', default = 'ABC')
parser.add_argument('-b', action='store', dest='yyy')
parser.add_argument('-c', action='store', dest='zzz')
args = parser.parse_args()
I want the code to work like this:
If b and c are given, do command2. Otherwise, do command1
if -a argument is given, then adding -b or -c throws an error
I tried this way:
if args.xxx and (args.yyy or args.zzz):
parser.print_help()
sys.exit()
But it didn't worked, because '-a' always has a deafult value and i can't change it. How can i fix it?