From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 19 Feb 2023 19:11:40 +0000 (-0800) Subject: gh-99735: Use required=True in argparse subparsers example (GH-100927) X-Git-Tag: v3.11.3~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4969903f7ea9393303dab0d48886b4d10095a063;p=thirdparty%2FPython%2Fcpython.git gh-99735: Use required=True in argparse subparsers example (GH-100927) (cherry picked from commit 6aab56f3c2ee331116eba242d2fcdca592577328) Co-authored-by: Patricio Paez --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index eeb65160bbc8..7a36c5264aa0 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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')