cli: enable TAB-completion for proxy properties in interactive editor

This commit is contained in:
Jiří Klimeš 2017-01-17 10:18:00 +01:00 committed by Thomas Haller
parent 1abee2e0d5
commit 6397ce1fac
2 changed files with 15 additions and 1 deletions

View file

@ -5657,6 +5657,8 @@ should_complete_files (const char *prompt, const char *line)
"phase2-private-key",
/* 'team' and 'team-port' properties */
"config",
/* 'proxy' properties */
"pac-script",
NULL
};
return _get_and_check_property (prompt, line, file_properties, NULL, NULL);

View file

@ -2354,6 +2354,18 @@ nmc_property_proxy_set_method (NMSetting *setting, const char *prop,
return TRUE;
}
static const char **
nmc_property_proxy_allowed_method (NMSetting *setting, const char *prop)
{
static const char **words = NULL;
if (!words)
words = nm_utils_enum_get_values (nm_setting_proxy_method_get_type(),
NM_SETTING_PROXY_METHOD_NONE,
G_MAXINT);
return words;
}
static gboolean
nmc_property_proxy_set_pac_script (NMSetting *setting, const char *prop,
const char *val, GError **error)
@ -8155,7 +8167,7 @@ nmc_properties_init (void)
nmc_property_proxy_set_method,
NULL,
NULL,
NULL,
nmc_property_proxy_allowed_method,
NULL);
nmc_add_prop_funcs (GLUE (PROXY, BROWSER_ONLY),
nmc_property_proxy_get_browser_only,