summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-07-27 14:53:03 +0200
committerLubomir Rintel <lkundrak@v3.sk>2016-08-01 13:52:36 +0200
commit81e8575a4652e2ce78721ab2a122f5a572140419 (patch)
tree378fa2d34ac7a759b5405952324f28ee67511b82
parent8e7c94ed07a15a600d4cd015dc722cf055a81fce (diff)
downloadNetworkManager-81e8575a4652e2ce78721ab2a122f5a572140419.tar.gz
cli: don't call the nmc_do_cmds() default handler if we're at the end of command completion
-rw-r--r--clients/cli/common.c3
1 files changed, 3 insertions, 0 deletions
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)