summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/commands.py10
-rw-r--r--lib/listcommands.py2
2 files changed, 3 insertions, 9 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')
diff --git a/lib/listcommands.py b/lib/listcommands.py
index 04202a4..2d90cea 100644
--- a/lib/listcommands.py
+++ b/lib/listcommands.py
@@ -13,7 +13,7 @@ class ListCommands(object):
'quit' : None,
'clear' : None,
'set' : ['user'],
- 'get' : ['i', ['user', 'host', 'port', 'socket_path', 'db'], 'user?']
+ 'get' : ['i', ['user', 'host', 'port', 'unix_socket_path', 'db'], 'user?']
}
@staticmethod