diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2017-12-20 15:01:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 15:01:26 -0800 |
commit | 460d9a418ecf95e06fe800a37a02a186ba8fc0ae (patch) | |
tree | f55825339548a442ad38f5fc251498c70d5221ff | |
parent | b2e572bf8291c54ea0ced8a6e43444ed6ed2c744 (diff) | |
parent | 8bd7a7a94f4615836de3c431ef5e97da60c77801 (diff) |
Merge pull request #824 from delicb/feature/username-in-password-prompt
Include username to password prompt. #823
-rw-r--r-- | pgcli/main.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index 846b41cc..e69fb0e9 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -365,7 +365,7 @@ class PGCli(object): # If we successfully parsed a password from a URI, there's no need to # prompt for it, even with the -W flag if self.force_passwd_prompt and not passwd: - passwd = click.prompt('Password', hide_input=True, + passwd = click.prompt('Password for %s' % user, hide_input=True, show_default=False, type=str) # Prompt for a password after 1st attempt to connect without a password @@ -383,8 +383,9 @@ class PGCli(object): except (OperationalError, InterfaceError) as e: if ('no password supplied' in utf8tounicode(e.args[0]) and auto_passwd_prompt): - passwd = click.prompt('Password', hide_input=True, - show_default=False, type=str) + passwd = click.prompt('Password for %s' % user, + hide_input=True, show_default=False, + type=str) pgexecute = PGExecute(database, user, passwd, host, port, dsn, **kwargs) else: |