nmcli: strip whitespace when reading property name in edit mode

When reading the property name in edit mode, any white space should be
striped from the entered value. Especially, because tab completion will
add a trailing whitespace.

Example:

  $ nmcli connection edit
  Enter connection type: ethernet
  nmcli> goto connection
  nmcli connection> describe
  Property name? u<TAB>

The <TAB> will complete 'u' to 'uuid '.
This whitespace should be allowed and striped.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2013-08-21 10:40:01 +02:00
parent d6aaa988db
commit 76186d652f

View File

@@ -4553,7 +4553,7 @@ ask_check_property (const char *arg,
if (!arg) {
printf (_("Available properties: %s\n"), valid_props_str);
prop_name_user = readline_x (EDITOR_PROMPT_PROPERTY);
prop_name_user = g_strstrip (readline_x (EDITOR_PROMPT_PROPERTY));
} else
prop_name_user = g_strdup (arg);