Adjusting for formatting guidelines
This commit is contained in:
parent
5f3ace5ca3
commit
f5d68e9336
1 changed files with 21 additions and 18 deletions
|
|
@ -125,15 +125,18 @@ static char *my_rl_complete(char *token, int *match)
|
||||||
|
|
||||||
auto& cmd = cli_commands();
|
auto& cmd = cli_commands();
|
||||||
int partlen = strlen (token); /* Part of token */
|
int partlen = strlen (token); /* Part of token */
|
||||||
for (std::string it : cmd) {
|
for (const std::string it : cmd)
|
||||||
if (!strncmp ( it.c_str(), token, partlen)) {
|
{
|
||||||
|
if (it.compare(0, partlen, token) == 0)
|
||||||
|
{
|
||||||
method_name = it;
|
method_name = it;
|
||||||
matchlen = partlen;
|
matchlen = partlen;
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 1) {
|
if (count == 1)
|
||||||
|
{
|
||||||
*match = 1;
|
*match = 1;
|
||||||
method_name += " ";
|
method_name += " ";
|
||||||
return strdup (method_name.c_str() + matchlen);
|
return strdup (method_name.c_str() + matchlen);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue