diff options
author | Thomas Haller <thaller@redhat.com> | 2019-03-01 08:45:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-03-07 22:22:39 +0100 |
commit | 4a137f919b452255eef985ef1eee52c277599dd0 (patch) | |
tree | 1c899514cfcc3023df4c418ff83d588452f8d744 | |
parent | c5a247c4c081836f5995674a20a55f3266cabd2b (diff) | |
download | NetworkManager-4a137f919b452255eef985ef1eee52c277599dd0.tar.gz |
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 <TAB>
file type
(cherry picked from commit fea0f4a5eaa069b9019151ca9a43b6ee25a7f837)
-rw-r--r-- | clients/cli/connections.c | 7 |
1 files 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--; |