From b6849e4f35d3d6f62bad890dd95ca98b7ab0b615 Mon Sep 17 00:00:00 2001 From: Patricio Paez Date: Tue, 10 Jan 2023 16:26:18 -0600 Subject: [PATCH] Make providing a sub-command mandatory --- Doc/library/argparse.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 475cac70291e9a..f248fd94703f5a 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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')