summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2008-03-20 13:43:35 -0700
committerTom Grennan <tgrennan@vyatta.com>2008-03-20 13:43:35 -0700
commit6695763f68fbf3acfb6c69739deca28217eaf8ef (patch)
tree395b48e2e2dd9268b9e480ae883f900a1b1b5ffc /etc
parentfbdbc9d257bd6682f9b70323e90469f188ea0dd0 (diff)
downloadvyatta-op-6695763f68fbf3acfb6c69739deca28217eaf8ef.tar.gz
vyatta-op-6695763f68fbf3acfb6c69739deca28217eaf8ef.zip
fix bug 3017
don't pipe through VYATTA_PAGER if run_cmd itself is a pager or tail
Diffstat (limited to 'etc')
-rw-r--r--etc/bash_completion.d/10vyatta-op14
1 files changed, 9 insertions, 5 deletions
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"