diff options
-rw-r--r-- | clients/cli/common.c | 9 | ||||
-rw-r--r-- | clients/cli/connections.c | 25 |
2 files changed, 29 insertions, 5 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c index e37d9d8c8b..c9e0bbbd43 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1137,8 +1137,13 @@ _rl_compentry_func_wrap_fcn (const char *text, int state) { g_return_val_if_fail (_rl_compentry_func_wrap.initialized, NULL); - if ( !_rl_compentry_func_wrap.values - || !_rl_compentry_func_wrap.values[_rl_compentry_func_wrap.idx]) { + while ( _rl_compentry_func_wrap.values + && _rl_compentry_func_wrap.values[_rl_compentry_func_wrap.idx] + && !g_str_has_prefix (_rl_compentry_func_wrap.values[_rl_compentry_func_wrap.idx], text)) + _rl_compentry_func_wrap.idx++; + + if ( !_rl_compentry_func_wrap.values + || !_rl_compentry_func_wrap.values[_rl_compentry_func_wrap.idx]) { g_strfreev (_rl_compentry_func_wrap.values); _rl_compentry_func_wrap.values = NULL; _rl_compentry_func_wrap.initialized = FALSE; diff --git a/clients/cli/connections.c b/clients/cli/connections.c index bc10949e57..9227f8b5ab 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -4962,10 +4962,29 @@ gen_cmd_save (const char *text, int state) static rl_compentry_func_t * gen_connection_types (const char *text) { - gs_strfreev char **values = NULL; + gs_free char **values = NULL; + const NMMetaSettingInfoEditor *editor; + GPtrArray *array; + int i; + + array = g_ptr_array_new (); + + for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { + editor = &nm_meta_setting_infos_editor[i]; + if (!editor->valid_parts) + continue; + g_ptr_array_add (array, (gpointer) nm_meta_setting_infos[i].setting_name); + if (editor->alias) + g_ptr_array_add (array, (gpointer) editor->alias); + } + + g_ptr_array_add (array, "bond-slave"); + g_ptr_array_add (array, "bridge-slave"); + g_ptr_array_add (array, "team-slave"); + g_ptr_array_add (array, NULL); + + values = (char **) g_ptr_array_free (array, FALSE); - values = _meta_abstract_complete ((const NMMetaAbstractInfo *) nm_meta_property_info_connection_type, - text); return nmc_rl_compentry_func_wrap ((const char *const*) values); } |