cli: don't call the nmc_do_cmds() default handler if we're at the end of command completion

This commit is contained in:
Lubomir Rintel 2016-07-27 14:53:03 +02:00
parent 8e7c94ed07
commit 81e8575a46

View file

@ -1434,6 +1434,9 @@ nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char
{
const NMCCommand *c;
if (argc == 0 && nmc->complete)
return nmc->return_value;
if (argc == 1 && nmc->complete) {
for (c = cmds; c->cmd; ++c) {
if (!*cmd || matches (cmd, c->cmd) == 0)