From 5f3ace5ca31088f26e56c1cbe7353eabcb607a43 Mon Sep 17 00:00:00 2001 From: John Jones Date: Tue, 6 Mar 2018 08:06:18 -0500 Subject: [PATCH] Added space at end of completed command --- src/rpc/cli.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index 3f0b065..b585bc2 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -126,16 +126,17 @@ static char *my_rl_complete(char *token, int *match) auto& cmd = cli_commands(); int partlen = strlen (token); /* Part of token */ for (std::string it : cmd) { - if (!strncmp ( it.c_str(), token, partlen)) { - method_name = it; - matchlen = partlen; - count ++; - } + if (!strncmp ( it.c_str(), token, partlen)) { + method_name = it; + matchlen = partlen; + count ++; + } } if (count == 1) { - *match = 1; - return strdup (method_name.c_str() + matchlen); + *match = 1; + method_name += " "; + return strdup (method_name.c_str() + matchlen); } return NULL;