Skip to content

Commit 6aab56f

Browse files
authored
gh-99735: Use required=True in argparse subparsers example (#100927)
1 parent 36b6709 commit 6aab56f

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
@@ -1867,7 +1867,7 @@ Sub-commands
18671867
...
18681868
>>> # create the top-level parser
18691869
>>> parser = argparse.ArgumentParser()
1870-
>>> subparsers = parser.add_subparsers()
1870+
>>> subparsers = parser.add_subparsers(required=True)
18711871
>>>
18721872
>>> # create the parser for the "foo" command
18731873
>>> parser_foo = subparsers.add_parser('foo')

0 commit comments

Comments
 (0)