summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2018-06-15 14:36:17 -0700
committerGitHub <noreply@github.com>2018-06-15 14:36:17 -0700
commitaee99b9a40e17b07a252e388aff7a016691a043c (patch)
treecf5c526493c20dfa067144eaff54aecb96d859d1
parent3fbe8e7cb3ca57fd8656890ea7855da62d2ea03e (diff)
parente6506eef4d0feaf269fae76392c47743716ffa9b (diff)
Merge pull request #898 from oivoodoo/refactor/add-user-option
Add --user option like psql has as well.
-rw-r--r--AUTHORS1
-rw-r--r--changelog.rst2
-rw-r--r--pgcli/main.py2
3 files changed, 5 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 16f76a79..d9631d64 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -80,6 +80,7 @@ Contributors:
* Jason Ribeiro
* Rishi Ramraj
* Matthieu Guilbert
+ * Alexandr Korsak
Creator:
diff --git a/changelog.rst b/changelog.rst
index bd0438f6..d07faa01 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -14,6 +14,7 @@ Internal changes:
* Add an is_special command flag to MetaQuery (Thanks: `Rishi Ramraj`_)
* Ported Destructive Warning from mycli.
* Refactor Destructive Warning behave tests (Thanks: `Dick Marinus`_)
+* Add `--user` option, duplicate of `--username`, the same cli option like `psql` (Thanks: `Alexandr Korsak`_)
Bug Fixes:
----------
@@ -834,3 +835,4 @@ Improvements:
.. _`Jason Ribeiro`: https://github.com/jrib
.. _`Rishi Ramraj`: https://github.com/RishiRamraj
.. _`Matthieu Guilbert`: https://github.com/gma2th
+.. _`Alexandr Korsak`: https://github.com/oivoodoo
diff --git a/pgcli/main.py b/pgcli/main.py
index 10e841cb..f577a1c8 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -890,6 +890,8 @@ class PGCli(object):
'postgres instance is listening.', envvar='PGPORT', type=click.INT)
@click.option('-U', '--username', 'username_opt', envvar='PGUSER',
help='Username to connect to the postgres database.')
+@click.option('--user', 'username_opt', envvar='PGUSER',
+ help='Username to connect to the postgres database.')
@click.option('-W', '--password', 'prompt_passwd', is_flag=True, default=False,
help='Force password prompt.')
@click.option('-w', '--no-password', 'never_prompt', is_flag=True,