|
1 | 1 | 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 |
3 | 3 |
|
4 | 4 | from click.core import Command, Group, Argument, Option, Parameter, Context
|
5 | 5 | from click.types import ParamType
|
@@ -91,7 +91,7 @@ def option(
|
91 | 91 | cls: type = Option,
|
92 | 92 | # Option
|
93 | 93 | show_default: bool = False,
|
94 |
| - prompt: bool = False, |
| 94 | + prompt: Union[bool, Text] = False, |
95 | 95 | confirmation_prompt: bool = False,
|
96 | 96 | hide_input: bool = False,
|
97 | 97 | is_flag: Optional[bool] = None,
|
@@ -120,7 +120,7 @@ def confirmation_option(
|
120 | 120 | cls: type = Option,
|
121 | 121 | # Option
|
122 | 122 | show_default: bool = False,
|
123 |
| - prompt: str = 'Do you want to continue?', |
| 123 | + prompt: Union[bool, Text] = 'Do you want to continue?', |
124 | 124 | confirmation_prompt: bool = False,
|
125 | 125 | hide_input: bool = False,
|
126 | 126 | is_flag: bool = True,
|
@@ -148,7 +148,7 @@ def password_option(
|
148 | 148 | cls: type = Option,
|
149 | 149 | # Option
|
150 | 150 | show_default: bool = False,
|
151 |
| - prompt: bool = True, |
| 151 | + prompt: Union[bool, Text] = True, |
152 | 152 | confirmation_prompt: bool = True,
|
153 | 153 | hide_input: bool = True,
|
154 | 154 | is_flag: Optional[bool] = None,
|
@@ -178,7 +178,7 @@ def version_option(
|
178 | 178 | # Option
|
179 | 179 | prog_name: Optional[str] = None,
|
180 | 180 | show_default: bool = False,
|
181 |
| - prompt: bool = False, |
| 181 | + prompt: Union[bool, Text] = False, |
182 | 182 | confirmation_prompt: bool = False,
|
183 | 183 | hide_input: bool = False,
|
184 | 184 | is_flag: bool = True,
|
@@ -206,7 +206,7 @@ def help_option(
|
206 | 206 | cls: type = Option,
|
207 | 207 | # Option
|
208 | 208 | show_default: bool = False,
|
209 |
| - prompt: bool = False, |
| 209 | + prompt: Union[bool, Text] = False, |
210 | 210 | confirmation_prompt: bool = False,
|
211 | 211 | hide_input: bool = False,
|
212 | 212 | is_flag: bool = True,
|
|
0 commit comments