]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99735: Use required=True in argparse subparsers example (#100927)
authorPatricio Paez <nospam@pp.com.mx>
Sun, 19 Feb 2023 01:06:03 +0000 (19:06 -0600)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 01:06:03 +0000 (17:06 -0800)
Doc/library/argparse.rst

index dbaa5d0d9b995b920e38857d83e2664ba908b24d..34b4c61649b99f422346e5a9a1643e2bf70ac652 100644 (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')