diff options
| author | John Southworth <john.southworth@vyatta.com> | 2011-10-11 10:53:32 -0500 |
|---|---|---|
| committer | John Southworth <john.southworth@vyatta.com> | 2011-10-11 10:53:32 -0500 |
| commit | 4d6c2da56687608f034be1b3de6fed82092418c4 (patch) | |
| tree | 5567b6043761a25d6383db7604eb9777024ddb01 | |
| parent | d1c97b55447cdda54869baeb509ff46f386f826d (diff) | |
| download | vyatta-op-4d6c2da56687608f034be1b3de6fed82092418c4.tar.gz vyatta-op-4d6c2da56687608f034be1b3de6fed82092418c4.zip | |
Fix ambiguous error text so that it doesn't show node.def, generate the completions using compgen -d
| -rw-r--r-- | etc/bash_completion.d/vyatta-op | 2 | ||||
| -rw-r--r-- | functions/interpreter/vyatta-op-run | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index 2f50214..5bcc460 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -281,7 +281,7 @@ _vyatta_op_invalid_completion () # output proper error message based on the above expansion if [[ "${arg[1]}" == "ambiguous" ]]; then echo -ne "\n\n Ambiguous command: ${args[@]} [$arg]\n" - local -a cmds=( "$tpath/$arg"* ) + local -a cmds=( $(compgen -d $tpath/$arg) ) _vyatta_op_node_path=$tpath local comps=$(_vyatta_op_help $arg ${cmds[@]##*/}) echo -ne "$comps" | sed -e 's/^P/ P/' diff --git a/functions/interpreter/vyatta-op-run b/functions/interpreter/vyatta-op-run index 8508c71..b128000 100644 --- a/functions/interpreter/vyatta-op-run +++ b/functions/interpreter/vyatta-op-run @@ -132,7 +132,7 @@ _vyatta_op_run () # output proper error message based on the above expansion if [[ "${arg[1]}" == "ambiguous" ]]; then echo -ne "\n Ambiguous command: ${args[@]} [$arg]\n" - local -a cmds=( "$tpath/$arg"* ) + local -a cmds=( $(compgen -d $tpath/$arg) ) _vyatta_op_node_path=$tpath local comps=$(_vyatta_op_help $arg ${cmds[@]##*/}) echo -e "$comps\n" | sed -e 's/^P/ P/' |
