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

This commit is contained in:
Patricio Paez 2023-02-18 19:06:03 -06:00 committed by GitHub
parent 36b670908b
commit 6aab56f3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')