Skip to content

Commit dfa0d20

Browse files
committed
PromptOption: Don't show default if it is the new (for 8.3) UNSET value.
1 parent 0023007 commit dfa0d20

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

consolekit/options.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
import consolekit.input
7272
from consolekit._types import Callback, _ConvertibleType
7373

74+
try:
75+
# 3rd party
76+
from click.core import UNSET # type: ignore[attr-defined]
77+
except ImportError:
78+
UNSET = object()
79+
7480
__all__ = (
7581
"verbose_option",
7682
"version_option",
@@ -497,6 +503,7 @@ def prompt_for_value(self, ctx: click.Context): # noqa: MAN002
497503
show_choices=self.show_choices,
498504
confirmation_prompt=self.confirmation_prompt,
499505
value_proc=lambda x: self.process_value(ctx, x),
506+
show_default=default is not UNSET,
500507
)
501508

502509

0 commit comments

Comments
 (0)