Skip to content

Commit 81191e4

Browse files
fizykJelleZijlstra
authored andcommitted
click.*option function parameter to accepts bool and Text (#1699)
This follows documentation and code which allows to use both bool and Text. Update all the prompt arguments for all *option functions in click.decorators module since they're mostly proxying the call to option setting desired defaults. closes #1693
1 parent 89cfa64 commit 81191e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

third_party/2and3/click/decorators.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from distutils.version import Version
2-
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
2+
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, Text
33

44
from click.core import Command, Group, Argument, Option, Parameter, Context
55
from click.types import ParamType
@@ -91,7 +91,7 @@ def option(
9191
cls: type = Option,
9292
# Option
9393
show_default: bool = False,
94-
prompt: bool = False,
94+
prompt: Union[bool, Text] = False,
9595
confirmation_prompt: bool = False,
9696
hide_input: bool = False,
9797
is_flag: Optional[bool] = None,
@@ -120,7 +120,7 @@ def confirmation_option(
120120
cls: type = Option,
121121
# Option
122122
show_default: bool = False,
123-
prompt: str = 'Do you want to continue?',
123+
prompt: Union[bool, Text] = 'Do you want to continue?',
124124
confirmation_prompt: bool = False,
125125
hide_input: bool = False,
126126
is_flag: bool = True,
@@ -148,7 +148,7 @@ def password_option(
148148
cls: type = Option,
149149
# Option
150150
show_default: bool = False,
151-
prompt: bool = True,
151+
prompt: Union[bool, Text] = True,
152152
confirmation_prompt: bool = True,
153153
hide_input: bool = True,
154154
is_flag: Optional[bool] = None,
@@ -178,7 +178,7 @@ def version_option(
178178
# Option
179179
prog_name: Optional[str] = None,
180180
show_default: bool = False,
181-
prompt: bool = False,
181+
prompt: Union[bool, Text] = False,
182182
confirmation_prompt: bool = False,
183183
hide_input: bool = False,
184184
is_flag: bool = True,
@@ -206,7 +206,7 @@ def help_option(
206206
cls: type = Option,
207207
# Option
208208
show_default: bool = False,
209-
prompt: bool = False,
209+
prompt: Union[bool, Text] = False,
210210
confirmation_prompt: bool = False,
211211
hide_input: bool = False,
212212
is_flag: bool = True,

0 commit comments

Comments
 (0)