From 8f0cb9482f4d4051c6542099acf60eafb82ee5f9 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 29 Nov 2007 18:21:57 -0800 Subject: * add completion for "pipe". * don't use eval for "show". --- etc/bash_completion.d/20vyatta-cfg | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index fe64f40..ee640f9 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -54,8 +54,8 @@ show () args[${#args[@]}]="$arg" fi done - eval "${vyatta_sbindir}/vyatta-output-config.pl ${show_all}\ - \${VYATTA_EDIT_LEVEL//\// } ${args[@]}" + ${vyatta_sbindir}/vyatta-output-config.pl ${show_all} \ + ${VYATTA_EDIT_LEVEL//\// } ${args[@]} } save () @@ -705,6 +705,20 @@ vyatta_config_complete () end_space=1 (( num_comp -= 1 )) fi + + # handle pipe + if [ "${COMP_WORDS[$num_comp]}" == "|" ]; then + declare -a hitems=( "more" \ + ) + declare -a hstrs=( \ + "Paginate the output" \ + ) + generate_help_text hitems hstrs + vyatta_completions=( "${hitems[@]}" ) + vyatta_do_complete + return + fi + (( last_idx = num_comp - 1 )) comp_words=( ${COMP_WORDS[@]:1:$num_comp} ) -- cgit v1.2.3