From b89c6d9fcbdd4bfbee93ec6797d702e568478bec Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Tue, 6 Feb 2024 14:37:05 -0600 Subject: [PATCH] docs: document trailing underscore behavior --- src/argh/assembling.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/argh/assembling.py b/src/argh/assembling.py index cad4319..3150a8a 100644 --- a/src/argh/assembling.py +++ b/src/argh/assembling.py @@ -409,6 +409,13 @@ def set_default_command( If the parser was created with ``add_help=True`` (which is by default), option name ``-h`` is silently removed from any argument. + .. note:: + + Function argument names ending with an underscore will have a single + trailing underscore removed before being converted to CLI arguments. + This allows CLI arguments to have names that would otherwise clash with + a reserved word or shadow a builtin. + """ func_signature = inspect.signature(function)