diff options
author | Santo Cariotti <sancn@live.com> | 2017-07-20 16:44:05 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-07-20 16:44:05 +0200 |
commit | 8969490de9e77c1db842d0e5a33be3d82763f9c6 (patch) | |
tree | ea13a2d02bfe6afe09b84bf70688720e2a0a2ae1 /lib/commands.py | |
parent | 3a8127c40245dc9af4da5173b576d872dc0973b1 (diff) |
get info is better than before
Diffstat (limited to 'lib/commands.py')
-rw-r--r-- | lib/commands.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/commands.py b/lib/commands.py index e016772..1302195 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -43,16 +43,10 @@ class Commands(object): print(r.hget('user:'+host, 'name').decode('utf-8')) else: print('nil') - elif cmd[2] == 'host': - print(co['host']) - elif cmd[2] == 'port': - print(co['post']) - elif cmd[2] == 'socket_path': - print(co['unix_socket_path']) - elif cmd[2] == 'db': - print(co['db']) elif cmd[2] not in ListCommands.commands['get'][1]: ListCommands.err('keyword') + else: + print(co[cmd[2]]) elif cmd[1] == 'user?': if len(cmd) > 3: raise PersonalError(Colors.grey + 'get user?' + Colors.red + ' accetta 1 parametro') |