I'm facing a problem in my python program, I have two optional arguments, the problem is that there must be at least one of these two arguments that must be used but the two arguments can't be passed together, is there a way of doing this with argparse ?
Here is the code I'm currently using:
parser = argparse.ArgumentParser(description='worker')
arser.add_argument('-i', "--item", type=bool, default=False, required=False)
parser.add_argument('-o', "--offer", type=bool, default=False, required=False)
Here are some examples of how I would like it to work:
./main.py -i True=> OK./main.py -o True=> OK./main.py -o True -i True=> Not OK
main.py item,main.py offer.