From 60f57ebe4aae91cf9a1ffef5cf58c6756310ff06 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 20 Nov 2017 21:55:06 +0100 Subject: [PATCH] cli: fix connection type completion Don't show completion for all setting types but only for base ones. Before: $ nmcli connection add type 802-11-olpc-mesh ethernet ppp 802-11-wireless generic pppoe 802-11-wireless-security gsm proxy 802-1x infiniband serial 802-3-ethernet ip-tunnel team adsl ipv4 team-port bluetooth ipv6 tun bond macsec user bridge macvlan vlan bridge-port olpc-mesh vpn cdma ovs-bridge vxlan connection ovs-interface wifi dcb ovs-patch wifi-sec dummy ovs-port wimax After: $ nmcli connection add type 802-11-olpc-mesh cdma macsec team 802-11-wireless dummy macvlan tun 802-3-ethernet ethernet olpc-mesh vlan adsl generic ovs-bridge vpn bluetooth gsm ovs-interface vxlan bond infiniband ovs-port wifi bridge ip-tunnel pppoe wimax --- clients/common/nm-meta-setting-desc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 4835b0fb56..1de88ef580 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -2310,6 +2310,9 @@ _complete_fcn_connection_type (ARGS_COMPLETE_FCN) const NMMetaSettingInfoEditor *setting_info = &nm_meta_setting_infos_editor[i]; const char *v; + if (!setting_info->valid_parts) + continue; + v = setting_info->alias; if (v) { if (!text || strncmp (text, v, text_len) == 0)