From 9ebeeb6bf2389ecc79164cf010f3d169506f7ab8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 16 Nov 2020 09:59:15 +0100 Subject: [PATCH] cli: fix shell completion for connection.type to show "ovs-{dpkg,patch}" nmcli --complete-args connection add type '' would not show "ovs-{dpdk,patch}", because the conditions about what makes a base type are not consistent with what NMSettingConnection's verify() does. Fix that. --- clients/common/nm-meta-setting-desc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 35758b8f3a..aa6fa0dbf0 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -2561,9 +2561,10 @@ static const char *const *_complete_fcn_connection_type(ARGS_COMPLETE_FCN) for (i = 0, j = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { const NMMetaSettingInfoEditor *setting_info = &nm_meta_setting_infos_editor[i]; + GType gtype = setting_info->general->get_setting_gtype(); const char * v; - if (!setting_info->valid_parts) + if (_nm_setting_type_get_base_type_priority(gtype) == NM_SETTING_PRIORITY_INVALID) continue; v = setting_info->alias;