cli: print valid-values hint in property menu for empty "set" command

nmcli 802-11-wireless.mode> set
Allowed values for 'mode' property: infrastructure, adhoc, ap
Enter 'mode' value:

(cherry picked from commit db0f5b3b4c)
This commit is contained in:
Jiří Klimeš 2015-05-11 17:07:20 +02:00 committed by Lubomir Rintel
parent 1203f224f9
commit 9e65dbd711

View file

@ -7060,9 +7060,16 @@ property_edit_submenu (NmCli *nmc,
* ADD adds the new value(s)
* single values: : both SET and ADD sets the new value
*/
if (!cmd_property_arg)
if (!cmd_property_arg) {
const char **avals = nmc_setting_get_property_allowed_values (curr_setting, prop_name);
if (avals) {
char *avals_str = nmc_util_strv_for_display (avals, FALSE);
g_print (_("Allowed values for '%s' property: %s\n"),
prop_name, avals_str);
g_free (avals_str);
}
prop_val_user = nmc_readline (_("Enter '%s' value: "), prop_name);
else
} else
prop_val_user = g_strdup (cmd_property_arg);
/* nmc_setting_set_property() only adds new value, thus we have to