diff --git a/clients/cli/utils.c b/clients/cli/utils.c index ea2c7de860..8cbfe9f2fa 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -1092,7 +1092,18 @@ _print_fill (const NmcConfig *nmc_config, nm_assert (!to_free || value == to_free); - if (!nmc_config->overview || !is_default) + 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 + * elegible to be hidden. + * + * In general, only new API shall mark itself eligible to be hidden. + * Long established properties cannot, because it would be a change + * in behavior. */ + } else header_cell->to_print = TRUE; if (NM_FLAGS_HAS (text_out_flags, NM_META_ACCESSOR_GET_OUT_FLAGS_STRV)) { diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index acb0a223b1..31f1dd51bd 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -148,6 +148,11 @@ typedef enum { typedef enum { NM_META_ACCESSOR_GET_OUT_FLAGS_NONE = 0, NM_META_ACCESSOR_GET_OUT_FLAGS_STRV = (1LL << 0), + + /* the property allows to be hidden, if and only if, it's value is set to the + * default. This should only be set by new properties, to preserve behavior + * of old properties, which were always printed. */ + NM_META_ACCESSOR_GET_OUT_FLAGS_HIDE = (1LL << 1), } NMMetaAccessorGetOutFlags; typedef enum {