summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2019-07-01 16:37:14 -0500
committerThomas Haller <thaller@redhat.com>2019-07-02 18:04:14 +0200
commitf0e4137e1dc49c424ca082bd79715fcbab5ee654 (patch)
treec0dbd2f36a391e11f94e462468c45f5fbee0e7b5 /clients
parente92dca357f8d34b3b5a4a13999ee4ea4ce41363d (diff)
downloadNetworkManager-f0e4137e1dc49c424ca082bd79715fcbab5ee654.tar.gz
cli: complete *-slave types (bond-slave, bridge-slave, team-slave)
While shorthand for "type ethernet slave-type <foo>" they are accepted as types by nmcli so we might as well complete them. https://bugzilla.redhat.com/show_bug.cgi?id=1654062 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/193
Diffstat (limited to 'clients')
-rw-r--r--clients/common/nm-meta-setting-desc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index c8268da6fc..1422d4d24e 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -2466,8 +2466,9 @@ _complete_fcn_connection_type (ARGS_COMPLETE_FCN)
guint i, j;
char **result;
gsize text_len;
+ const char *slave_types[] = {"bond-slave", "bridge-slave", "team-slave"};
- result = g_new (char *, _NM_META_SETTING_TYPE_NUM * 2 + 1);
+ result = g_new (char *, _NM_META_SETTING_TYPE_NUM * 2 + G_N_ELEMENTS (slave_types) + 1);
text_len = text ? strlen (text) : 0;
@@ -2487,6 +2488,12 @@ _complete_fcn_connection_type (ARGS_COMPLETE_FCN)
if (!text || strncmp (text, v, text_len) == 0)
result[j++] = g_strdup (v);
}
+ for (i = 0; i < G_N_ELEMENTS (slave_types); i++) {
+ const char *v = slave_types[i];
+
+ if (!text || strncmp (text, v, text_len) == 0)
+ result[j++] = g_strdup (v);
+ }
if (j)
result[j++] = NULL;
else {