I am trying to make the parameter -i required only if the parameter -r isn't present. This is what I have at the moment:
parser.add_argument(
'-i', '--input-location',
help='Input location',
required=True,
dest='input_location'
)
parser.add_argument(
'-r','--report',
help='Show data report ',
required=False,
default=False,
action='store_true'
)
So in nearly all cases -i will be required as a parameter:
python program.py -i /input_location
But if -r parameter is used then the -i parameter won't be needed:
python program.py -r