From 81e8575a4652e2ce78721ab2a122f5a572140419 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 27 Jul 2016 14:53:03 +0200 Subject: [PATCH] cli: don't call the nmc_do_cmds() default handler if we're at the end of command completion --- clients/cli/common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/cli/common.c b/clients/cli/common.c index 019f16e3bb..8b4a6aede5 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -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)