From f7cf247b61e0a1a44da7f99b39b948335f2f959b Mon Sep 17 00:00:00 2001 From: John Southworth Date: Wed, 12 Sep 2012 13:15:07 -0700 Subject: Fix a few completion bugs 1. Bugfix 8254: Show the help text first so users don't think there is only one completion for a value when it exists with non-comps 2. Fix config mode inconsistencies with operational mode. Show all values in help text. 3. Fix "exists_only" command handling. Only show nodes that exist when doing completion for show, comment, and delete. --- src/cstore/cstore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp index cc8a029..43abebd 100644 --- a/src/cstore/cstore.cpp +++ b/src/cstore/cstore.cpp @@ -694,7 +694,7 @@ Cstore::getCompletionEnv(const Cpath& comps, string& env) * "enumeration" * "$VAR(@) in ..." */ - if (def->getEnumeration() || def->getAllowed()) { + if (!exists_only && (def->getEnumeration() || def->getAllowed())) { /* do "enumeration" or "allowed". * note: emulate original implementation and set up COMP_WORDS and * COMP_CWORD environment variables. these are needed by some @@ -741,7 +741,7 @@ Cstore::getCompletionEnv(const Cpath& comps, string& env) * shell into an array of values. */ free(buf); - } else if (def->getActions(syntax_act)) { + } else if (!exists_only && def->getActions(syntax_act)) { // look for "self ref in values" from syntax const valstruct *vals = get_syntax_self_in_valstruct(def->getActions(syntax_act)); -- cgit v1.2.3