I\'ve been using argparse for a Python program that can -process, -upload or both:
parser = argparse.ArgumentParser(de
This achieves the purpose and this will also be relfected in the argparse autogenerated --help output, which is imho what most sane programmers want (also works with optional arguments):
parser.add_argument(
'commands',
nargs='+', # require at least 1
choices=['process', 'upload'], # restrict the choice
help='commands to execute'
)
Official docs on this: https://docs.python.org/3/library/argparse.html#choices