mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-18 14:20:42 +02:00
nmcli: reword error message for a wrong user input in edit mode
Before, when specifying a setting.property with missing property name, the following happened: nmcli> set connection. Error: invalid property: '' not among [... Reword this special error case of a missing property to make it more clear. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
1111dbf812
commit
f6703f540c
1 changed files with 8 additions and 2 deletions
|
|
@ -483,8 +483,14 @@ nmc_string_is_valid (const char *input, const char **allowed, GError **error)
|
|||
finish:
|
||||
if (ret == NULL) {
|
||||
char *valid_vals = g_strjoinv (", ", (char **) allowed);
|
||||
g_set_error (error, 1, 0, _("'%s' not among [%s]"),
|
||||
input ? input : "", valid_vals);
|
||||
if (!input || !*input) {
|
||||
g_set_error (error, 1, 0, _("missing name, try one of [%s]"),
|
||||
valid_vals);
|
||||
} else {
|
||||
g_set_error (error, 1, 0, _("'%s' not among [%s]"),
|
||||
input ? input : "", valid_vals);
|
||||
}
|
||||
|
||||
g_free (valid_vals);
|
||||
}
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue