Skip to content

Commit f193fad

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 8520e6c commit f193fad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/argparse.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ Sub-commands
17711771
...
17721772
>>> # create the top-level parser
17731773
>>> parser = argparse.ArgumentParser()
1774-
>>> subparsers = parser.add_subparsers()
1774+
>>> subparsers = parser.add_subparsers(required=True)
17751775
>>>
17761776
>>> # create the parser for the "foo" command
17771777
>>> parser_foo = subparsers.add_parser('foo')

0 commit comments

Comments
 (0)