From a9d49d010f6cf803075eaa60a7d36843374a2466 Mon Sep 17 00:00:00 2001 From: megrez Date: Wed, 26 Dec 2018 22:32:27 +0100 Subject: [PATCH] use single entry for command execution --- lib/redis.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/redis.js b/lib/redis.js index 5fe5c84..232fdc0 100644 --- a/lib/redis.js +++ b/lib/redis.js @@ -86,19 +86,7 @@ class RedisClient { readline.cursorTo(process.stdout, 0, 0); readline.clearScreenDown(process.stdout); } else { - let func = this._redis_client[`${CMD}Async`]; - if (typeof func == "function") { - let result = await func.bind(this._redis_client)(...commands); - if (Array.isArray(result)) { - result.forEach((item, index) => { - console.log("%d) %s", index, item); - }); - } else { - console.log(result); - } - } else { - console.log(colors.red(`(error) ${CMD} is not supported`)); - } + this.execute(commands); } } rl.prompt();