gh-99735: Use required=True in argparse subparsers example (GH-100927)

(cherry picked from commit 6aab56f3c2)

Co-authored-by: Patricio Paez <nospam@pp.com.mx>
This commit is contained in:
Miss Islington (bot) 2023-02-19 11:11:40 -08:00 committed by GitHub
parent 62db23c944
commit 4969903f7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1854,7 +1854,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')