File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1564,12 +1564,12 @@ it exits and prints the error along with a usage message::
15641564 >>> # invalid option
15651565 >>> parser.parse_args(['--bar'])
15661566 usage: PROG [-h] [--foo FOO] [bar]
1567- PROG: error: no such option : --bar
1567+ PROG: error: unrecognized arguments : --bar
15681568
15691569 >>> # wrong number of arguments
15701570 >>> parser.parse_args(['spam', 'badger'])
15711571 usage: PROG [-h] [--foo FOO] [bar]
1572- PROG: error: extra arguments found : badger
1572+ PROG: error: unrecognized arguments: badger
15731573
15741574
15751575Arguments containing ``- ``
@@ -1606,7 +1606,7 @@ there are no options in the parser that look like negative numbers::
16061606 >>> # negative number options present, so -2 is an option
16071607 >>> parser.parse_args(['-2'])
16081608 usage: PROG [-h] [-1 ONE] [foo]
1609- PROG: error: no such option : -2
1609+ PROG: error: unrecognized arguments : -2
16101610
16111611 >>> # negative number options present, so both -1s are options
16121612 >>> parser.parse_args(['-1', '-1'])
You can’t perform that action at this time.
0 commit comments