diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-10 17:05:50 -0800 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-10 17:05:50 -0800 |
commit | c9f651ba39562bc7fa471f75fb859c26400b5dfe (patch) | |
tree | 3d14a21d7d34706669b297c399295371761ba454 | |
parent | 39a039fb8eb731495ef5774199502154a08e75ad (diff) | |
parent | 8d502bf0cc920e473a16286ab0f150b83200ab35 (diff) |
Merge pull request #105 from fpietka/master
allows pgcli to connect to specified user's database
-rwxr-xr-x | pgcli/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index 9a89cf4f..dd2506a7 100755 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -99,8 +99,11 @@ class PGCli(object): # Connect to the database. if not database: - # default to current OS username just like psql - database = user = getuser() + if user: + database = user + else: + # default to current OS username just like psql + database = user = getuser() # Prompt for a password immediately if requested via the -W flag. This # avoids wasting time trying to connect to the database and catching a |