mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-99735: Use required=True in argparse subparsers example (#100927)
This commit is contained in:
parent
36b670908b
commit
6aab56f3c2
1 changed files with 1 additions and 1 deletions
|
@ -1867,7 +1867,7 @@ Sub-commands
|
|||
...
|
||||
>>> # create the top-level parser
|
||||
>>> parser = argparse.ArgumentParser()
|
||||
>>> subparsers = parser.add_subparsers()
|
||||
>>> subparsers = parser.add_subparsers(required=True)
|
||||
>>>
|
||||
>>> # create the parser for the "foo" command
|
||||
>>> parser_foo = subparsers.add_parser('foo')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue