From cb0929163507ecad0b907cb9ae3c1695d25d93aa Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 2 Feb 2026 16:20:21 +0100 Subject: [PATCH] nmcli: fix hiding default values A property should be hidden when it has the default value and one of the following conditions is met: - nmcli is called in "overview" mode (with flag -o) - the property has the HIDE flag Previously, properties with the HIDE flag were always hidden. Fix that. --- src/nmcli/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nmcli/utils.c b/src/nmcli/utils.c index a613c28fc6..e52941f40f 100644 --- a/src/nmcli/utils.c +++ b/src/nmcli/utils.c @@ -1103,8 +1103,9 @@ _print_fill(const NmcConfig *nmc_config, nm_assert(!to_free || value == to_free); - if ((is_default && nmc_config->overview) - || NM_FLAGS_HAS(text_out_flags, NM_META_ACCESSOR_GET_OUT_FLAGS_HIDE)) { + if (is_default + && (nmc_config->overview + || NM_FLAGS_HAS(text_out_flags, NM_META_ACCESSOR_GET_OUT_FLAGS_HIDE))) { /* don't mark the entry for display. This is to shorten the output in case * the property is the default value. But we only do that, if the user * opts in to this behavior (-overview), or of the property marks itself