Skip to content

Commit 4969903

Browse files
gh-99735: Use required=True in argparse subparsers example (GH-100927)
(cherry picked from commit 6aab56f) Co-authored-by: Patricio Paez <[email protected]>
1 parent 62db23c commit 4969903

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ Sub-commands
18541854
...
18551855
>>> # create the top-level parser
18561856
>>> parser = argparse.ArgumentParser()
1857-
>>> subparsers = parser.add_subparsers()
1857+
>>> subparsers = parser.add_subparsers(required=True)
18581858
>>>
18591859
>>> # create the parser for the "foo" command
18601860
>>> parser_foo = subparsers.add_parser('foo')

0 commit comments

Comments
 (0)