summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 15:29:58 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 15:29:58 -0800
commit62b07a426534c9579d409e3fcd51847eb4e3c670 (patch)
tree0998dca0d363a7811a9269cff0b45fc7b02f935b /etc
parentfeca89bb0a7c5745f1d871ea997ab7517555f1a0 (diff)
downloadvyatta-op-62b07a426534c9579d409e3fcd51847eb4e3c670.tar.gz
vyatta-op-62b07a426534c9579d409e3fcd51847eb4e3c670.zip
invalid op-mode command results in error message
Diffstat (limited to 'etc')
-rw-r--r--etc/bash_completion.d/10vyatta-op11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op
index cf40e59..9da12aa 100644
--- a/etc/bash_completion.d/10vyatta-op
+++ b/etc/bash_completion.d/10vyatta-op
@@ -207,11 +207,20 @@ _vyatta_op_run ()
tpath+=/node.tag
else
echo "Invalid command" >&2
+ eval $restore_shopts
return 1
fi
done
- eval "$(_vyatta_op_get_node_def_field $tpath/node.def run)"
+ local run_cmd=$(_vyatta_op_get_node_def_field $tpath/node.def run)
+ local ret=0
+ if [ -n "$run_cmd" ]; then
+ eval "$run_cmd"
+ else
+ echo "Invalid command" >&2
+ ret=1
+ fi
eval $restore_shopts
+ return $ret
}
# don't initialize if we are in configure mode