mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 05:50:12 +01:00
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:
parent
1203f224f9
commit
9e65dbd711
1 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue