summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-07-20 16:41:23 +0200
committerSanto Cariotti <sancn@live.com>2017-07-20 16:41:23 +0200
commit3a8127c40245dc9af4da5173b576d872dc0973b1 (patch)
treefa27460e4023bc12f3217bbf2571d083d0256c18
parentf13d8c416b1bc1a0a7b2c07d2c9913ef11f3328f (diff)
added all config sets into get command
-rw-r--r--lib/commands.py9
-rw-r--r--lib/listcommands.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/commands.py b/lib/commands.py
index 0e59c12..e016772 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -1,5 +1,6 @@
from classes import userexist, PersonalError, r, host, clear, Colors
from listcommands import ListCommands
+from config import config as co
class Commands(object):
@@ -43,9 +44,13 @@ class Commands(object):
else:
print('nil')
elif cmd[2] == 'host':
- print('localhost')
+ print(co['host'])
elif cmd[2] == 'port':
- print('6379')
+ 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')
elif cmd[1] == 'user?':
diff --git a/lib/listcommands.py b/lib/listcommands.py
index 74079c9..04202a4 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'], 'user?']
+ 'get' : ['i', ['user', 'host', 'port', 'socket_path', 'db'], 'user?']
}
@staticmethod