summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-21 22:29:42 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-10-21 22:29:42 -0700
commit8fee94bcf3f9435a34dafd11ac05076ec3841876 (patch)
tree2ec52475aac1136f4934b43719733a1b00cff6f3 /etc
parentbdff038a5a59a895316e9c004596e16fd099c28d (diff)
downloadvyatta-cfg-8fee94bcf3f9435a34dafd11ac05076ec3841876.tar.gz
vyatta-cfg-8fee94bcf3f9435a34dafd11ac05076ec3841876.zip
Fix a few config completion mistakes: help text was no longer being paged (this differed from op mode). Fix the Invalid top level command help text
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bash_completion.d/vyatta-cfg9
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg
index 81d41f5..f9736fa 100755
--- a/etc/bash_completion.d/vyatta-cfg
+++ b/etc/bash_completion.d/vyatta-cfg
@@ -593,7 +593,7 @@ vyatta_do_complete ()
vyatta_do_help=false
elif $vyatta_do_help ||
[ ${#vyatta_completions[@]} -eq 0 ]; then
- printf "$vyatta_help_text"
+ printf "$vyatta_help_text" | ${VYATTA_PAGER:-cat}
COMPREPLY=( "" " " )
fi
vyatta_help_text="\\nNo help text available"
@@ -671,7 +671,7 @@ vyatta_simple_complete ()
vyatta_do_help=false
elif $vyatta_do_help ||
[ ${#vyatta_completions[@]} -eq 0 ]; then
- printf "$vyatta_help_text"
+ printf "$vyatta_help_text" | ${VYATTA_PAGER:-cat}
COMPREPLY=( "" " " )
fi
vyatta_help_text="\\nNo help text available"
@@ -843,7 +843,10 @@ vyatta_config_complete ()
get_help_text
vyatta_completions=( "${_get_help_text_items[@]}" )
if [[ ${#vyatta_completions[@]} -eq 0 ]]; then
- vyatta_help_text="\n\n Invalid command: [${COMP_WORDS[COMP_CWORD]}]"
+ echo -ne "\n\n Invalid command: [${COMP_WORDS[COMP_CWORD]}]"
+ COMPREPLY=( "" " " )
+ eval $restore_shopts
+ return
fi
vyatta_do_complete "$@"
eval $restore_shopts