mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-03 20:40:36 +01:00
nmcli: replace SLAVE with PORT in con show
We missed to change the term here back in the conscious language effort. In this case, it doesn't make sense to show it as a duplicated entry, both PORT and SLAVE, as it is shown in columns and not in rows. Instead, replace entirely SLAVE with PORT. However, still, accept `-f SLAVE` as an alias of `-f PORT`.
This commit is contained in:
parent
098d829abd
commit
2fd56f9c13
8 changed files with 657 additions and 626 deletions
|
|
@ -191,6 +191,17 @@ nm_meta_abstract_info_get_name(const NMMetaAbstractInfo *abstract_info, gboolean
|
|||
return n;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_meta_abstract_info_get_alias(const NMMetaAbstractInfo *abstract_info)
|
||||
{
|
||||
nm_assert(abstract_info);
|
||||
nm_assert(abstract_info->meta_type);
|
||||
|
||||
if (abstract_info->meta_type->get_alias)
|
||||
return abstract_info->meta_type->get_alias(abstract_info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const NMMetaAbstractInfo *const *
|
||||
nm_meta_abstract_info_get_nested(const NMMetaAbstractInfo *abstract_info,
|
||||
guint *out_len,
|
||||
|
|
@ -466,10 +477,15 @@ _output_selection_select_one(const NMMetaAbstractInfo *const *fields_array,
|
|||
|
||||
for (i = 0; fields_array[i]; i++) {
|
||||
const NMMetaAbstractInfo *fi = fields_array[i];
|
||||
const char *name, *alias;
|
||||
const NMMetaAbstractInfo *const *nested;
|
||||
gs_free gpointer nested_to_free = NULL;
|
||||
|
||||
if (g_ascii_strcasecmp(i_name, nm_meta_abstract_info_get_name(fi, FALSE)) != 0)
|
||||
name = nm_meta_abstract_info_get_name(fi, FALSE);
|
||||
alias = nm_meta_abstract_info_get_alias(fi);
|
||||
|
||||
if (g_ascii_strcasecmp(i_name, name) != 0
|
||||
&& (alias == NULL || g_ascii_strcasecmp(i_name, alias) != 0))
|
||||
continue;
|
||||
|
||||
if (!right || !validate_nested) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const NMMetaSettingInfoEditor *const *nm_meta_setting_infos_editor_p(void);
|
|||
|
||||
const char *nm_meta_abstract_info_get_name(const NMMetaAbstractInfo *abstract_info,
|
||||
gboolean for_header);
|
||||
const char *nm_meta_abstract_info_get_alias(const NMMetaAbstractInfo *abstract_info);
|
||||
|
||||
const NMMetaAbstractInfo *const *
|
||||
nm_meta_abstract_info_get_nested(const NMMetaAbstractInfo *abstract_info,
|
||||
|
|
|
|||
|
|
@ -482,6 +482,7 @@ struct _NMMetaType {
|
|||
NMObjBaseClass parent;
|
||||
const char *type_name;
|
||||
const char *(*get_name)(const NMMetaAbstractInfo *abstract_info, gboolean for_header);
|
||||
const char *(*get_alias)(const NMMetaAbstractInfo *abstract_info);
|
||||
const NMMetaAbstractInfo *const *(*get_nested)(const NMMetaAbstractInfo *abstract_info,
|
||||
guint *out_len,
|
||||
gpointer *out_to_free);
|
||||
|
|
|
|||
|
|
@ -818,8 +818,11 @@ _metagen_con_show_get_fcn(NMC_META_GENERIC_INFO_GET_FCN_ARGS)
|
|||
}
|
||||
|
||||
const NmcMetaGenericInfo *const metagen_con_show[_NMC_GENERIC_INFO_TYPE_CON_SHOW_NUM + 1] = {
|
||||
#define _METAGEN_CON_SHOW(type, name) \
|
||||
[type] = NMC_META_GENERIC(name, .info_type = type, .get_fcn = _metagen_con_show_get_fcn)
|
||||
#define _METAGEN_CON_SHOW(type, name, ...) \
|
||||
[type] = NMC_META_GENERIC(name, \
|
||||
.info_type = type, \
|
||||
.get_fcn = _metagen_con_show_get_fcn, \
|
||||
__VA_ARGS__)
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_NAME, "NAME"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_UUID, "UUID"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_TYPE, "TYPE"),
|
||||
|
|
@ -833,7 +836,7 @@ const NmcMetaGenericInfo *const metagen_con_show[_NMC_GENERIC_INFO_TYPE_CON_SHOW
|
|||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_DEVICE, "DEVICE"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_STATE, "STATE"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_ACTIVE_PATH, "ACTIVE-PATH"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_PORT, "SLAVE"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_PORT, "PORT", .alias = "SLAVE"),
|
||||
_METAGEN_CON_SHOW(NMC_GENERIC_INFO_TYPE_CON_SHOW_FILENAME, "FILENAME"),
|
||||
};
|
||||
#define NMC_FIELDS_CON_SHOW_COMMON "NAME,UUID,TYPE,DEVICE"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ _meta_type_nmc_generic_info_get_name(const NMMetaAbstractInfo *abstract_info, gb
|
|||
return info->name;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_meta_type_nmc_generic_info_get_alias(const NMMetaAbstractInfo *abstract_info)
|
||||
{
|
||||
const NmcMetaGenericInfo *info = (const NmcMetaGenericInfo *) abstract_info;
|
||||
|
||||
return info->alias;
|
||||
}
|
||||
|
||||
static const NMMetaAbstractInfo *const *
|
||||
_meta_type_nmc_generic_info_get_nested(const NMMetaAbstractInfo *abstract_info,
|
||||
guint *out_len,
|
||||
|
|
@ -101,6 +109,7 @@ _meta_type_nmc_generic_info_get_fcn(const NMMetaAbstractInfo *abstract_info,
|
|||
const NMMetaType nmc_meta_type_generic_info = {
|
||||
.type_name = "nmc-generic-info",
|
||||
.get_name = _meta_type_nmc_generic_info_get_name,
|
||||
.get_alias = _meta_type_nmc_generic_info_get_alias,
|
||||
.get_nested = _meta_type_nmc_generic_info_get_nested,
|
||||
.get_fcn = _meta_type_nmc_generic_info_get_fcn,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@ struct _NmcMetaGenericInfo {
|
|||
NmcGenericInfoType info_type;
|
||||
const char *name;
|
||||
const char *name_header;
|
||||
const char *alias;
|
||||
const NmcMetaGenericInfo *const *nested;
|
||||
|
||||
#define NMC_META_GENERIC_INFO_GET_FCN_ARGS \
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1078,30 +1078,30 @@ Strony podręcznika nmcli(1) i nmcli-examples(7) zawierają pełne informacje
|
|||
o użyciu.
|
||||
|
||||
<<<
|
||||
size: 1448
|
||||
size: 1444
|
||||
location: src/tests/client/test-client.py:test_004()/25
|
||||
cmd: $NMCLI -f all connection show --order na:-active
|
||||
lang: C
|
||||
returncode: 0
|
||||
stdout: 1288 bytes
|
||||
stdout: 1284 bytes
|
||||
>>>
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH PORT FILENAME
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
|
||||
<<<
|
||||
size: 1448
|
||||
size: 1444
|
||||
location: src/tests/client/test-client.py:test_004()/26
|
||||
cmd: $NMCLI -f all connection show --order active:-na
|
||||
lang: C
|
||||
returncode: 0
|
||||
stdout: 1288 bytes
|
||||
stdout: 1284 bytes
|
||||
>>>
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH PORT FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
|
||||
<<<
|
||||
size: 6815
|
||||
|
|
@ -58539,34 +58539,34 @@ wlan1 wifi rozłączono nieznane nieznane /org/freedes
|
|||
wlan1 wifi rozłączono nieznane nieznane /org/freedesktop/NetworkManager/Devices/5 -- -- --
|
||||
|
||||
<<<
|
||||
size: 2074
|
||||
size: 2068
|
||||
location: src/tests/client/test-client.py:test_004()/932
|
||||
cmd: $NMCLI -f all connection show
|
||||
lang: C
|
||||
returncode: 0
|
||||
stdout: 1932 bytes
|
||||
stdout: 1926 bytes
|
||||
>>>
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/4 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx2 UUID-con-xx2-REPLACED-REPLACED-REPLA ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/4 yes eth0 activated /org/freedesktop/NetworkManager/ActiveConnection/3 -- /etc/NetworkManager/system-connections/con-xx2
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH PORT FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/3 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/2 yes wlan0 activated /org/freedesktop/NetworkManager/ActiveConnection/4 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx2 UUID-con-xx2-REPLACED-REPLACED-REPLA ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/4 yes eth0 activated /org/freedesktop/NetworkManager/ActiveConnection/3 -- /etc/NetworkManager/system-connections/con-xx2
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
|
||||
<<<
|
||||
size: 2090
|
||||
size: 2084
|
||||
location: src/tests/client/test-client.py:test_004()/933
|
||||
cmd: $NMCLI -f all connection show
|
||||
lang: pl_PL.UTF-8
|
||||
returncode: 0
|
||||
stdout: 1938 bytes
|
||||
stdout: 1932 bytes
|
||||
>>>
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH SLAVE FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/3 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/2 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/2 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/4 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx2 UUID-con-xx2-REPLACED-REPLACED-REPLA ethernet 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/4 tak eth0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/3 -- /etc/NetworkManager/system-connections/con-xx2
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/1 nie -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT AUTOCONNECT-PRIORITY READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH PORT FILENAME
|
||||
con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/3 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/2 -- /etc/NetworkManager/system-connections/con-vpn-1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/2 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/1 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/2 tak wlan0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/4 -- /etc/NetworkManager/system-connections/con-xx1
|
||||
con-xx2 UUID-con-xx2-REPLACED-REPLACED-REPLA ethernet 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/4 tak eth0 aktywowano /org/freedesktop/NetworkManager/ActiveConnection/3 -- /etc/NetworkManager/system-connections/con-xx2
|
||||
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/1 nie -- -- -- -- /etc/NetworkManager/system-connections/con-1
|
||||
|
||||
<<<
|
||||
size: 359
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue