cli: hide default setting of "connection.mud-url" from nmcli output

"connection.mud-url" is a commonly not used parameter, that most
users won't care. To minimize the output of

  $ nmcli connection show "$PROFILE"

hide the MUD URL if it is unset.

This mechanism of nmcli is not yet great, because there is currently
no way to print a default value, and

  $ nmcli -f connection.mud-url connection show "$PROFILE"

does not work as one would expect(??). But that is a shortcoming of the
general mechanism in nmcli, and not specific to the MUD URL property.
This commit is contained in:
Thomas Haller 2020-04-25 09:53:12 +02:00
parent 9b295f0df5
commit 3cf1e8395e
4 changed files with 517 additions and 654 deletions

View file

@ -5263,6 +5263,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_MUD_URL,
.property_type = &_pt_gobject_string,
.hide_if_default = TRUE,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT,
.property_type = &_pt_gobject_int,

View file

@ -502,12 +502,12 @@ NAME UUID TYPE DEVICE
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet --
<<<
size: 1306
size: 1263
location: clients/tests/test-client.py:test_002()/23
cmd: $NMCLI c s con-1
lang: C
returncode: 0
stdout: 1181 bytes
stdout: 1138 bytes
>>>
connection.id: con-1
connection.uuid: 5fcfd6d7-1e63-3332-8826-a7eda103792d
@ -532,16 +532,15 @@ connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.mud-url: --
connection.wait-device-timeout: -1
<<<
size: 1318
size: 1275
location: clients/tests/test-client.py:test_002()/24
cmd: $NMCLI c s con-1
lang: pl_PL.UTF-8
returncode: 0
stdout: 1183 bytes
stdout: 1140 bytes
>>>
connection.id: con-1
connection.uuid: 5fcfd6d7-1e63-3332-8826-a7eda103792d
@ -566,7 +565,6 @@ connection.metered: nieznane
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.mud-url: --
connection.wait-device-timeout: -1
<<<

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff