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 fea0f4a5ea)
This commit is contained in:
Thomas Haller 2019-03-01 08:45:02 +01:00
parent c5a247c4c0
commit 4a137f919b

View file

@ -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--;