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 <TAB>

 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 5e239d2c04)
This commit is contained in:
Beniamino Galvani 2017-12-01 14:14:24 +01:00
parent d2372f0a2e
commit e48b9300bd

View file

@ -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