From e62af43d12508da69efad923642bb7e3256b7ce1 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 7 Oct 2022 15:48:24 +0200 Subject: [PATCH] docs: Fix how bool flag vars are set This was changed for #4226, shortly after argparse was implemented. Fixes #9265 --- doc_src/cmds/argparse.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_src/cmds/argparse.rst b/doc_src/cmds/argparse.rst index 7ab173e41..c6b411ec3 100644 --- a/doc_src/cmds/argparse.rst +++ b/doc_src/cmds/argparse.rst @@ -168,7 +168,7 @@ Example OPTION_SPECs Some *OPTION_SPEC* examples: -- ``h/help`` means that both ``-h`` and ``--help`` are valid. The flag is a boolean and can be used more than once. If either flag is used then ``_flag_h`` and ``_flag_help`` will be set to the count of how many times either flag was seen. +- ``h/help`` means that both ``-h`` and ``--help`` are valid. The flag is a boolean and can be used more than once. If either flag is used then ``_flag_h`` and ``_flag_help`` will be set to however either flag was seen, as many times as it was seen. So it could be set to ``-h``, ``-h`` and ``--help``, and ``count $_flag_h`` would yield "3". - ``help`` means that only ``--help`` is valid. The flag is a boolean and can be used more than once. If it is used then ``_flag_help`` will be set to the count of how many times the long flag was seen. Also ``h-help`` (with an arbitrary short letter) for backwards compatibility.