dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.49k stars 663 forks source link

Add a user name to password prompt #1141

Open harri-halttunen-aktia opened 12 months ago

harri-halttunen-aktia commented 12 months ago

Description

It would be helpful to have a user name in a password prompt similarly as pgcli does, for example.

In mycli the code creating a prompt is:

                        new_passwd = click.prompt('Password', hide_input=True,
                                                  show_default=False, type=str, err=True)

whereas in pgcli the prompt is created like this:

            passwd = click.prompt(
                "Password for %s" % user, hide_input=True, show_default=False, type=str
            )

So, the change would not be a major one but the helpfulness of this change would be.

Motivation

Usually user names are different for each environment (or at least should be) thus showing a user name in password prompt gives some extra confidence but also gives an easier way to trigger something based on what is written on terminal.