From 2f60fdf19e2d0e29eedff8cff6574c0499373993 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 24 Aug 2018 09:52:09 +0200 Subject: [PATCH] cli: autocomplete connection type even if it has an alias Before, we would not autocomplete connection types that have an alias: Connection type: 6lowpan cdma macvlan vlan 802-11-olpc-mesh dummy olpc-mesh vpn 802-11-wireless ethernet ovs-bridge vxlan 802-3-ethernet generic ovs-interface wifi adsl gsm ovs-port wimax bluetooth infiniband pppoe wpan bond ip-tunnel team bridge macsec tun Connection type: 8 [-> no completion] Don't treat the default connection type (for example, "802-3-ethernet") in a special way and allow it to be autocompleted, because we already display it when the user did not enter any text. --- clients/common/nm-meta-setting-desc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 29eb98a775..09f30641fa 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -2485,11 +2485,9 @@ _complete_fcn_connection_type (ARGS_COMPLETE_FCN) if (!text || strncmp (text, v, text_len) == 0) result[j++] = g_strdup (v); } - if (!text || !*text || !v) { - v = setting_info->general->setting_name; - if (!text || strncmp (text, v, text_len) == 0) - result[j++] = g_strdup (v); - } + v = setting_info->general->setting_name; + if (!text || strncmp (text, v, text_len) == 0) + result[j++] = g_strdup (v); } if (j) result[j++] = NULL;