Skip to content
Myr

normalize dots in prog_name for completion

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nick Muoh · committed by David Lord · parent bdb81e4 · Browse files · 2 files+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−1 removed

  • other:+6 added−1 removed

2 files+6 added−1 removed

modified:src/click/core.py+5 added-1 removed
1127 unmodified lines
1128 :param prog_name: Name of the executable in the shell.1129 :param complete_var: Name of the environment variable that holds1130 the completion instruction. Defaults to1131 ``_{PROG_NAME}_COMPLETE``.11321133 .. versionchanged:: 8.2.01134 Dots (``.``) in ``prog_name`` are replaced with underscores (``_``).1135 """1136 if complete_var is None:1134 complete_var = f"_{prog_name}_COMPLETE".replace("-", "_").upper()1137 complete_name = prog_name.replace("-", "_").replace(".", "_")1138 complete_var = f"_{complete_name}_COMPLETE".upper()11391140 instruction = os.environ.get(complete_var)11411142 if not instruction:
1885 unmodified lines
modified:CHANGES.rst+1 added
10 unmodified lines
11 :issue:`2398`12- Fix return value and type signature of `shell_completion.add_completion_class`13 function. :pr:`2421`14- Bash version detection doesn't fail on Windows. :issue:`2461`15- Completion works if there is a dot (``.``) in the program name. :issue:`2166`161718Version 8.1.319-------------
1040 unmodified lines