diff --git a/copier/user_data.py b/copier/user_data.py index 745082213..d702ed6a3 100644 --- a/copier/user_data.py +++ b/copier/user_data.py @@ -154,6 +154,9 @@ class Question: Additional text printed to the user, explaining the purpose of this question. Can be templated. + prompt: + The prompt used when asking the question. Can be templated. + multiline: Indicates if the question should allow multiline input. Defaults to `True` for JSON and YAML questions, and to `False` otherwise. @@ -188,6 +191,7 @@ class Question: choices: Union[Dict[Any, Any], List[Any]] = field(default_factory=list) default: Any = None help: str = "" + prompt: str = "" ask_user: bool = False multiline: Union[str, bool] = False placeholder: str = "" @@ -293,7 +297,10 @@ def get_message(self) -> str: if self.help: rendered_help = self.render_value(self.help) message = force_str_end(rendered_help) - message += f"{self.var_name}? Format: {self.get_type_name()}" + if self.prompt: + message += self.render_value(self.prompt) + else: + message += f"{self.var_name}? Format: {self.get_type_name()}" return message def get_placeholder(self) -> str: diff --git a/docs/changelog.md b/docs/changelog.md index 04c99a55c..60b7a6ed9 120000 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1 +1 @@ -../CHANGELOG.md \ No newline at end of file +../CHANGELOG.md diff --git a/docs/contributing.md b/docs/contributing.md index 44fcc6343..5c10c35f6 120000 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1 +1 @@ -../CONTRIBUTING.md \ No newline at end of file +../CONTRIBUTING.md diff --git a/docs/index.md b/docs/index.md index 32d46ee88..94389aee6 120000 --- a/docs/index.md +++ b/docs/index.md @@ -1 +1 @@ -../README.md \ No newline at end of file +../README.md