mirror of https://github.com/dbcli/pgcli
confirm_destructive_query: Use confirm rather than prompt
This commit is contained in:
parent
13ca7d2430
commit
2f556df6f8
1
AUTHORS
1
AUTHORS
|
@ -129,6 +129,7 @@ Contributors:
|
|||
* Damien Baty (dbaty)
|
||||
* blag
|
||||
* Rob Berry (rob-b)
|
||||
* Sharon Yogev (sharonyogev)
|
||||
|
||||
Creator:
|
||||
--------
|
||||
|
|
|
@ -32,6 +32,7 @@ Bug fixes:
|
|||
predetermined table aliases instead of generating aliases programmatically on
|
||||
the fly
|
||||
* Fixed SQL error when there is a comment on the first line: ([issue 1403](https://github.com/dbcli/pgcli/issues/1403))
|
||||
* Fix wrong usage of prompt instead of confirm when confirm execution of destructive query
|
||||
|
||||
Internal:
|
||||
---------
|
||||
|
|
|
@ -16,9 +16,9 @@ def confirm_destructive_query(queries, keywords, alias):
|
|||
if alias:
|
||||
info += f" in {click.style(alias, fg='red')}"
|
||||
|
||||
prompt_text = f"{info}.\nDo you want to proceed? (y/n)"
|
||||
prompt_text = f"{info}.\nDo you want to proceed?"
|
||||
if is_destructive(queries, keywords) and sys.stdin.isatty():
|
||||
return prompt(prompt_text, type=bool)
|
||||
return confirm(prompt_text)
|
||||
|
||||
|
||||
def confirm(*args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue