From e48b9300bd124ca371ab48c9275243096b2e88aa Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 1 Dec 2017 14:14:24 +0100 Subject: [PATCH] cli: don't print warnings when completing arguments $ nmcli con add type wifi ifname wlan0 \ wifi-sec.key-mgmt none \ wifi-sec.wep-key0 $ascii_key \ ssid completes the line with: "Info:\ WEP\ key\ is\ guessed\ to\ be\ of\ '2\ \(passphrase\)'" The environment warning function should not emit warning when completing arguments. (cherry picked from commit 5e239d2c04728250e4cc2eb36b2005333cfac810) --- clients/cli/settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/cli/settings.c b/clients/cli/settings.c index e0db1b5bd4..69275aad48 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -371,8 +371,12 @@ _env_warn_fcn_handle (const NMMetaEnvironment *environment, const char *fmt_l10n, /* the untranslated format string, but it is marked for translation using N_(). */ va_list ap) { + NmCli *nmc = environment_user_data; gs_free char *m = NULL; + if (nmc->complete) + return; + NM_PRAGMA_WARNING_DISABLE("-Wformat-nonliteral") m = g_strdup_vprintf (_(fmt_l10n), ap); NM_PRAGMA_WARNING_REENABLE