To reproduce:
>>> import argparse
[74536 refs]
>>> parser = argparse.ArgumentParser()
[74809 refs]
>>> parser.add_argument("foo")
>>> parser.add_argument("foo")
>>> parser.parse_args(["bar"])
usage: ipython [-h] foo foo
ipython: error: too few arguments
An exception has occurred, use %tb to see the full traceback.
SystemExit: 2
>>> parser.parse_args(["bar", "baz"])
>>> Namespace(foo='baz')
So it actually makes you provide two arguments, but it loses/ignores the first one and there's no way to get it back. |