From c602f8e70435f8337ddafcb067bab230dd2a093c Mon Sep 17 00:00:00 2001 From: slioch Date: Thu, 3 Sep 2009 10:49:19 -0700 Subject: now supports quoted values for op mode commands --- etc/bash_completion.d/10vyatta-op | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'etc') 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 -- cgit v1.2.3