diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-07 15:29:58 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-07 15:29:58 -0800 |
commit | 62b07a426534c9579d409e3fcd51847eb4e3c670 (patch) | |
tree | 0998dca0d363a7811a9269cff0b45fc7b02f935b | |
parent | feca89bb0a7c5745f1d871ea997ab7517555f1a0 (diff) | |
download | vyatta-op-62b07a426534c9579d409e3fcd51847eb4e3c670.tar.gz vyatta-op-62b07a426534c9579d409e3fcd51847eb4e3c670.zip |
invalid op-mode command results in error message
-rw-r--r-- | etc/bash_completion.d/10vyatta-op | 11 |
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 |