parse_args ([]) usage: PROG [-h] foo [foo...] PROG: error: the following arguments are required: foo If the nargs keyword argument is not provided, the number of arguments consumed is determined by the action.
parse_args ([ '--foo', '2' ]) Namespace(foo='2') >>> parser.