summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-29 18:21:57 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-29 18:21:57 -0800
commit8f0cb9482f4d4051c6542099acf60eafb82ee5f9 (patch)
tree62731aff5c1af7cd77a997a0665913671da38ebd
parent1d78b0c336c8d3ae62f65983098584a6e2e613ce (diff)
downloadvyatta-cfg-8f0cb9482f4d4051c6542099acf60eafb82ee5f9.tar.gz
vyatta-cfg-8f0cb9482f4d4051c6542099acf60eafb82ee5f9.zip
* add completion for "pipe".
* don't use eval for "show".
-rw-r--r--etc/bash_completion.d/20vyatta-cfg18
1 files changed, 16 insertions, 2 deletions
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} )