From 3e3d36450c69ce50e777b12ece979985a90a2aff Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Tue, 10 Jan 2017 11:26:09 +0100 Subject: [PATCH] nmcli: don't substitute empty strings with "--" in terse mode --- clients/cli/utils.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 20cd100b6..e0b9d1d9a 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -1072,11 +1072,16 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[]) gboolean section_prefix = field_values[0].flags & NMC_OF_FLAG_SECTION_PREFIX; gboolean main_header = main_header_add || main_header_only; - /* No headers are printed in terse mode: - * - neither main header nor field (column) names - */ - if ((main_header_only || field_names) && terse) - return; + if (terse) { + /* No headers are printed in terse mode: + * - neither main header nor field (column) names + */ + if (main_header_only || field_names) + return; + + /* Don't substitute empty strings in terse mode */ + not_set_str = ""; + } if (multiline) { /* --- Multiline mode --- */