mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-07 05:10:29 +01:00
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
(cherry picked from commit f0e4137e1d)
This commit is contained in:
parent
bea517465a
commit
4857e34b03
1 changed files with 8 additions and 1 deletions
|
|
@ -2507,8 +2507,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;
|
||||
|
||||
|
|
@ -2528,6 +2529,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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue