summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-08-30 18:00:17 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-08-30 18:00:17 -0500
commit11032d8d3273eab10dd33cc1947d4de23996c355 (patch)
tree2ab2401cb1c91431156cd8c8a58a84370dbf1ad6 /functions
parent1cd9bd0781e8f74625fad04ea3e49f761fd2de57 (diff)
downloadvyatta-op-11032d8d3273eab10dd33cc1947d4de23996c355.tar.gz
vyatta-op-11032d8d3273eab10dd33cc1947d4de23996c355.zip
Fix user defined wildcards such as in 'clear ip bgp *' and fix an error message to be consistent
Diffstat (limited to 'functions')
-rw-r--r--functions/interpreter/vyatta-op-run10
1 files changed, 7 insertions, 3 deletions
diff --git a/functions/interpreter/vyatta-op-run b/functions/interpreter/vyatta-op-run
index 4d223df..883e03e 100644
--- a/functions/interpreter/vyatta-op-run
+++ b/functions/interpreter/vyatta-op-run
@@ -124,7 +124,11 @@ _vyatta_op_run ()
i=1
declare -a args # array of expanded arguments
for arg in "$@"; do
- arg=( $(_vyatta_op_conv_node_path $tpath $arg) ) # expand the arguments
+ if [[ $arg == "*" ]]; then
+ arg="*" #leave user defined wildcards alone
+ else
+ arg=( $(_vyatta_op_conv_node_path $tpath $arg) ) # expand the arguments
+ fi
# output proper error message based on the above expansion
if [[ "${arg[1]}" == "ambiguous" ]]; then
echo -ne "\n Ambiguous command: ${args[@]} [$arg]\n"
@@ -140,16 +144,16 @@ _vyatta_op_run ()
return 1
fi
- args[$i]=$arg
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
+ echo -ne "\n Invalid command: ${args[@]} [$arg]\n\n" >&2
eval $restore_shopts
return 1
fi
+ args[$i]=$arg
let "i+=1"
done