From 136d191f1c96dbae1489fed7c2565f5e1b1f8d40 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 13 Jul 2020 22:03:16 +0200 Subject: New upstream version 1.26.0 --- clients/cli/utils.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'clients/cli/utils.h') diff --git a/clients/cli/utils.h b/clients/cli/utils.h index d7ad738f..02b81b70 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -288,6 +288,24 @@ nmc_meta_generic_get_str_i18n (const char *s, NMMetaAccessorGetType get_type) return s; } +static inline const char * +nmc_meta_generic_get_str_i18n_null (const char *s, NMMetaAccessorGetType get_type) +{ + if (get_type == NM_META_ACCESSOR_GET_TYPE_PARSABLE) { + /* in parsable mode, return NULL. That is useful if @s is a pretty string + * to describe a missing value (like "(unknown)"). We don't want to print + * that for parsable mode. */ + return NULL; + } + return nmc_meta_generic_get_str_i18n (s, get_type); +} + +static inline const char * +nmc_meta_generic_get_unknown (NMMetaAccessorGetType get_type) +{ + return nmc_meta_generic_get_str_i18n_null (N_("(unknown)"), get_type); +} + static inline const char * nmc_meta_generic_get_bool (gboolean val, NMMetaAccessorGetType get_type) { -- cgit 1.3.0-6-gf8a5