cli: consider empty value as "*" for "Interface name [*]: " prompt (rh #953397)

And, do it right this time.

https://bugzilla.redhat.com/show_bug.cgi?id=953397
This commit is contained in:
Jiří Klimeš 2013-12-18 16:10:48 +01:00
parent 340542a2f2
commit 80851c3550

View file

@ -4577,8 +4577,11 @@ do_connection_add (NmCli *nmc, int argc, char **argv)
|| strcmp (type, NM_SETTING_VLAN_SETTING_NAME) == 0)
ifname_mandatory = FALSE;
if (!ifname && ifname_mandatory && nmc->ask)
ifname = ifname_ask = nmc_get_user_input (_("Interface name: "));
if (!ifname && ifname_mandatory && nmc->ask) {
ifname = ifname_ask = nmc_get_user_input (_("Interface name [*]: "));
if (!ifname)
ifname = ifname_ask = g_strdup ("*");
}
if (!ifname && ifname_mandatory) {
g_string_printf (nmc->return_text, _("Error: 'ifname' argument is required."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;