We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 216ed6c commit bf4b0bbCopy full SHA for bf4b0bb
1 file changed
src/click/termui.py
@@ -68,12 +68,10 @@ def _build_prompt(
68
prompt = text
69
if type is not None and show_choices and isinstance(type, Choice):
70
prompt += f" ({', '.join(map(str, type.choices))})"
71
- if show_default:
72
- if isinstance(show_default, str):
73
- # Use the custom string for display
74
- prompt = f"{prompt} [({show_default})]"
75
- elif default is not None:
76
- prompt = f"{prompt} [{_format_default(default)}]"
+ if isinstance(show_default, str):
+ default = f"({show_default})"
+ if default is not None and show_default:
+ prompt = f"{prompt} [{_format_default(default)}]"
77
return f"{prompt}{suffix}"
78
79
0 commit comments