Skip to content

Commit 6f8c2be

Browse files
ppaezmiss-islington
authored andcommitted
pythongh-99735: Use required=True in argparse subparsers example (pythonGH-100927)
(cherry picked from commit 6aab56f) Co-authored-by: Patricio Paez <nospam@pp.com.mx>
1 parent d104234 commit 6f8c2be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
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)