summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2012-09-12 13:15:07 -0700
committerJohn Southworth <john.southworth@vyatta.com>2012-09-12 13:15:07 -0700
commitf7cf247b61e0a1a44da7f99b39b948335f2f959b (patch)
treef9d13cdaf89210f32248e08c351c8e1fd9b2ff2e /src
parent901a99523a399bde045b033cd16b4a5684f25151 (diff)
downloadvyatta-cfg-f7cf247b61e0a1a44da7f99b39b948335f2f959b.tar.gz
vyatta-cfg-f7cf247b61e0a1a44da7f99b39b948335f2f959b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/cstore/cstore.cpp4
1 files changed, 2 insertions, 2 deletions
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));