summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-09-07 13:27:58 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-09-07 13:31:17 -0500
commit46a54aea22f0c74135619eb2ca7d3e1daef4e643 (patch)
treed11506734fab7f368ed21d996d157884c0c0e120 /functions
parent78c85523954b10c40fab9a7f8f370606fd9cd1d0 (diff)
downloadvyatta-op-46a54aea22f0c74135619eb2ca7d3e1daef4e643.tar.gz
vyatta-op-46a54aea22f0c74135619eb2ca7d3e1daef4e643.zip
Fix some problems with the completion scripts
1. we don't need to call compopt -o filenames explicitly anymore the bash-completion scripts from the debian package do this more intelligently. 2. Restore shopts before running the command so that if the command is terminated with ctrl-c they will be set properly.
Diffstat (limited to 'functions')
-rw-r--r--functions/interpreter/vyatta-op-run3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions/interpreter/vyatta-op-run b/functions/interpreter/vyatta-op-run
index 2d578b9..8508c71 100644
--- a/functions/interpreter/vyatta-op-run
+++ b/functions/interpreter/vyatta-op-run
@@ -162,6 +162,7 @@ _vyatta_op_run ()
local ret=0
local cmd_regex="^(LESSOPEN=|less|pager|tail|/opt/vyatta/bin/vyatta-tshark-interface-port.pl).*"
if [ -n "$run_cmd" ]; then
+ eval $restore_shopts
if [[ -t 1 && "${args[1]}" == "show" && ! $run_cmd =~ $cmd_regex ]] ; then
eval "($run_cmd) | ${VYATTA_PAGER:-cat}"
else
@@ -169,9 +170,9 @@ _vyatta_op_run ()
fi
else
echo -ne "\n Incomplete command: ${args[@]}\n\n" >&2
+ eval $restore_shopts
ret=1
fi
- eval $restore_shopts
return $ret
}