cli: add functionality to hide properties from output

System Internals / NetworkManager - Thomas Haller [] - 10 August 2018 08:38 EDT

Historically, nmcli printed all fields during operations like `nmcli connection show "$PROFILE"`. As we supported more and more options, this resulted in a verbose output, of most properties just being the default values.

To counter that, we added the '-overview' option. When given, it would hide options that are set at their default. This option was not the default, to preserve established behavior.

However, for new options, we can afford to hide them. Add a mechanism, that property getters can mark their value to be hidden. At the moment, there is no way to show these properties. However, we could add a '-verbose' option, with the opposite meaning of '-overview'. Anyway, that does not seem necessary at the moment.

Hiding properties from output is only acceptable for new properties (otherwise we badly change behavior), and if the properties are set at their default values (otherwise, we hide important information).

582ee9114 cli: add functionality to hide properties from output
clients/cli/utils.c | 13 ++++++++++++-
clients/common/nm-meta-setting-desc.h | 5 +++++
2 files changed, 17 insertions(+), 1 deletion(-)


  • Share