From d2b4332b36686dd5d7382d996743f0ffa1a0fdda Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sun, 11 Jun 2017 22:31:43 +0200 Subject: [PATCH] cli: remove spurious device names from output When running one of: nmcli device wifi list ifname wlan0 nmcli device wifi connect ... ifname wlan0 nmcli wrongly adds the device name to the output. Do the completion only when requested. Fixes: 8679793f6b711847d3209ab3cfbd95ab4a2e2488 Fixes: 1a0dfd31c4af5f3e42b4fc8363a2065d8c5a325b --- clients/cli/devices.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 2b9411e55b..234a82e914 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -2625,7 +2625,8 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv) return NMC_RESULT_ERROR_USER_INPUT; } ifname = *argv; - complete_device (devices, ifname, TRUE); + if (argc == 1 && nmc->complete) + complete_device (devices, ifname, TRUE); } else if (strcmp (*argv, "bssid") == 0 || strcmp (*argv, "hwaddr") == 0) { /* hwaddr is deprecated and will be removed later */ argc--; @@ -2878,7 +2879,8 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) goto finish; } ifname = *argv; - complete_device (devices, ifname, TRUE); + if (argc == 1 && nmc->complete) + complete_device (devices, ifname, TRUE); } else if (strcmp (*argv, "bssid") == 0) { argc--; argv++;