nmcli: replace SLAVE for PORT, still accepting SLAVE as alias

With `nmcli -f SLAVE` the PORT column will be shown. In this case we
don't duplicate the field because it's typically shown in columns and
having duplicated columns is more annoying than a duplicated row.
This commit is contained in:
Íñigo Huguet 2026-03-04 12:28:34 +01:00
parent 3720c75104
commit ecc2b6da7c
3 changed files with 628 additions and 625 deletions

View file

@ -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"

File diff suppressed because it is too large Load diff

View file

@ -1080,30 +1080,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: 6858
@ -58613,34 +58613,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