summaryrefslogtreecommitdiffstats
path: root/iredis/entry.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:57 +0000
commitd71fd6264d58795c50b9350d7c39677b671e0896 (patch)
tree0aa9e0bd923a00b9ddda4e01af55a76ed314097c /iredis/entry.py
parentReleasing debian version 1.9.1-3. (diff)
downloadiredis-d71fd6264d58795c50b9350d7c39677b671e0896.tar.xz
iredis-d71fd6264d58795c50b9350d7c39677b671e0896.zip
Merging upstream version 1.9.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/entry.py')
-rw-r--r--iredis/entry.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/iredis/entry.py b/iredis/entry.py
index 8e396a4..eb57668 100644
--- a/iredis/entry.py
+++ b/iredis/entry.py
@@ -266,6 +266,7 @@ PAGER_HELP = """Using pager when output is too tall for your window, default to
help="Config file for iredis, default is ~/.iredisrc.",
)
@click.option("--decode", default=None, help=DECODE_HELP)
+@click.option("--client_name", help="Assign a name to the current connection.")
@click.option("--raw/--no-raw", default=None, is_flag=True, help=RAW_HELP)
@click.option("--rainbow/--no-rainbow", default=None, is_flag=True, help=RAINBOW)
@click.option("--shell/--no-shell", default=None, is_flag=True, help=SHELL)
@@ -278,6 +279,7 @@ def gather_args(
p,
n,
password,
+ client_name,
newbie,
iredisrc,
decode,
@@ -319,7 +321,8 @@ def gather_args(
if not sys.stdout.isatty():
config.raw = True
- config.newbie_mode = newbie
+ if newbie is not None:
+ config.newbie_mode = newbie
if decode is not None:
config.decode = decode
@@ -366,6 +369,7 @@ def create_client(params):
port = params["p"]
db = params["n"]
password = params["password"]
+ client_name = params["client_name"]
dsn_from_url = None
dsn = params["dsn"]
@@ -385,10 +389,19 @@ def create_client(params):
path=dsn_from_url.path,
scheme=dsn_from_url.scheme,
username=dsn_from_url.username,
+ client_name=client_name,
)
if params["socket"]:
- return Client(scheme="unix", path=params["socket"], db=db, password=password)
- return Client(host=host, port=port, db=db, password=password)
+ return Client(
+ scheme="unix",
+ path=params["socket"],
+ db=db,
+ password=password,
+ client_name=client_name,
+ )
+ return Client(
+ host=host, port=port, db=db, password=password, client_name=client_name
+ )
def main():