diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-04-20 08:56:31 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-04-20 14:08:43 +0200 |
commit | 5544b66bbdeaa4bba1051aec1cf8ecc08586f9b9 (patch) | |
tree | 8b19739f66bab68b377c8ab93f6a942c39391ce4 /clients/cli/common.c | |
parent | 2f0bb3327b30622ac6ede8b8e93b9a13ecb35408 (diff) | |
download | NetworkManager-bg/cli-completion.tar.gz |
cli: fix completion of connection typesbg/cli-completion
Return only main settings and the special slave types.
Diffstat (limited to 'clients/cli/common.c')
-rw-r--r-- | clients/cli/common.c | 9 |
1 files changed, 7 insertions, 2 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; |