I have 3 arguments in and mutually exclusive group. I want to make a new mandatory sub-command available for the '-a' argument and this argument should only be available for the '-a' argument.
What is the best way to do this? I have tried searching and reading this argparse docs But havent figured it out yet.
parser = argparse.ArgumentParser(prog='med-tool test', description='med-tool')
group = parser.add_mutually_exclusive_group(required=True)
parser.add_argument('-f', '--foo')
group.add_argument('-a', '--add', help ="Add device", metavar='')
group.add_argument('-d', '--get', help ="Get device", metavar='')
group.add_argument('-r', '--get', help ="Read device", metavar='')
args = parser.parse_args()