Skip to content

Commit

Permalink
docs: document trailing underscore behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
djpohly committed Feb 6, 2024
1 parent 55a3cda commit b89c6d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/argh/assembling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b89c6d9

Please sign in to comment.