summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/bash_completion.d/10vyatta-op23
1 files changed, 14 insertions, 9 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op
index 4735462..66154f8 100644
--- a/etc/bash_completion.d/10vyatta-op
+++ b/etc/bash_completion.d/10vyatta-op
@@ -306,17 +306,22 @@ _vyatta_op_run ()
_vyatta_op_last_comp=${_vyatta_op_last_comp_init}
false; estat=$?
- for arg ; do
- if [ -f "$tpath/$arg/node.def" ] ; then
- tpath+=/$arg
- elif [ -f $tpath/node.tag/node.def ] ; then
- tpath+=/node.tag
- else
- echo "Invalid command" >&2
+
+ i=1
+ for arg in "$@"
+ do
+ if [ -f "$tpath/$arg/node.def" ] ; then
+ tpath+=/$arg
+ elif [ -f $tpath/node.tag/node.def ] ; then
+ tpath+=/node.tag
+ else
+ echo "Invalid command" >&2
eval $restore_shopts
- return 1
- fi
+ return 1
+ fi
+ let "i+=1"
done
+
local run_cmd=$(_vyatta_op_get_node_def_field $tpath/node.def run)
local ret=0
if [ -n "$run_cmd" ]; then