From 8fee94bcf3f9435a34dafd11ac05076ec3841876 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Fri, 21 Oct 2011 22:29:42 -0700 Subject: 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 --- etc/bash_completion.d/vyatta-cfg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'etc') 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 -- cgit v1.2.3