diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2017-01-10 11:26:09 +0100 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2017-03-22 14:59:55 +0100 |
commit | c78dcaae8823d18d2e9fffd1e1fa14156a68f13c (patch) | |
tree | 2610dad53b1c34090bda2ec3fd30e8dc6162afcb | |
parent | 41aa4d0fa8b035ca200976d473dce0dabf040bc5 (diff) | |
download | NetworkManager-c78dcaae8823d18d2e9fffd1e1fa14156a68f13c.tar.gz |
nmcli: don't substitute empty strings with "--" in terse mode
-rw-r--r-- | clients/cli/utils.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 20cd100b61..e0b9d1d9a2 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 --- */ |