From 4a137f919b452255eef985ef1eee52c277599dd0 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 1 Mar 2019 08:45:02 +0100 Subject: [PATCH] cli: fix completion for `nmcli connection import` If we already specified "type" or "file", don't offer it for completion again. $ nmcli connection import type openvpn file type (cherry picked from commit fea0f4a5eaa069b9019151ca9a43b6ee25a7f837) --- clients/cli/connections.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 63cb0bb90c..856848f8fa 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -8888,8 +8888,11 @@ do_connection_import (NmCli *nmc, int argc, char **argv) } while (argc > 0) { - if (argc == 1 && nmc->complete) - nmc_complete_strings (*argv, "type", "file", NULL); + if (argc == 1 && nmc->complete) { + nmc_complete_strings (*argv, + type ? NULL : "type", + filename ? NULL : "file"); + } if (strcmp (*argv, "type") == 0) { argc--;