From 9e65dbd7110f989c6ed8b3de89f93bdf2475b46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 11 May 2015 17:07:20 +0200 Subject: [PATCH] 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 db0f5b3b4c737c50803e35e96475f240d3653695) --- clients/cli/connections.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 129452654a..86d09e1c17 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -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