From 6695763f68fbf3acfb6c69739deca28217eaf8ef Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Thu, 20 Mar 2008 13:43:35 -0700 Subject: fix bug 3017 don't pipe through VYATTA_PAGER if run_cmd itself is a pager or tail --- etc/bash_completion.d/10vyatta-op | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'etc/bash_completion.d/10vyatta-op') diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index ebff99f..b0d5dc9 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -19,17 +19,20 @@ # # **** End License **** -test -z "$_vyatta_default_pager" && \ - declare -r _vyatta_default_pager="less\ +test -z "$_vyatta_less_options" && \ + declare -r _vyatta_less_options="\ --QUIT-AT-EOF\ --quit-if-one-screen\ --LONG-PROMPT\ --RAW-CONTROL-CHARS\ --squeeze-blank-lines\ + --no-init" +test -z "$_vyatta_default_pager" && \ + declare -r _vyatta_default_pager="less --buffers=64\ --auto-buffers\ - --no-init\ - --no-lessopen" + --no-lessopen\ + $_vyatta_less_options" declare -x VYATTA_PAGER=$_vyatta_default_pager _vyatta_op_do_key_bindings () @@ -318,7 +321,8 @@ _vyatta_op_run () local run_cmd=$(_vyatta_op_get_node_def_field $tpath/node.def run) local ret=0 if [ -n "$run_cmd" ]; then - if [[ -t 1 && "$1" == "show" ]] ; then + if [[ -t 1 && "$1" == "show" && \ + ! $run_cmd =~ ^\(less\|more\|most\|pager\|tail\).* ]] ; then eval "($run_cmd) | ${VYATTA_PAGER:-cat}" else eval "$run_cmd" -- cgit v1.2.3