diff options
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rw-r--r-- | etc/bash_completion.d/20vyatta-cfg | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index fe64f40..dc05cf1 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -54,8 +54,9 @@ 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[@]} \ + | eval "${VYATTA_PAGER:-cat}" } save () @@ -705,6 +706,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} ) |