diff options
author | Tom Grennan <tgrennan@vyatta.com> | 2007-10-05 15:10:20 -0700 |
---|---|---|
committer | Tom Grennan <tgrennan@vyatta.com> | 2007-10-05 15:10:20 -0700 |
commit | 1bfc56dce4427e10da9c4522acea682ecaa170d1 (patch) | |
tree | b144ddc3214dd36bc7a73e82ace5d29b5f8c54f8 /etc | |
parent | 067320a0aa36ba97d64ff5473d4ad0b3877774e4 (diff) | |
download | vyatta-op-1bfc56dce4427e10da9c4522acea682ecaa170d1.tar.gz vyatta-op-1bfc56dce4427e10da9c4522acea682ecaa170d1.zip |
fix completion of nodes with wild card and named args
(i.e "set")
Diffstat (limited to 'etc')
-rw-r--r-- | etc/bash_completion.d/vyatta-op | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index 4b6bdfc..be4892d 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -277,13 +277,19 @@ _vyatta_op_expand () if _vyatta_op_scan 0 "${COMP_WORDS[@]}" ; then COMPREPLY=( ) if [ -n "${_vyatta_op_allowed[*]}" ] ; then + local nomatch=true + local joker=false for a in "${_vyatta_op_allowed[@]}" ; do if [ -n "$a" ] ; then COMPREPLY+=($( compgen -W "$a" -- $cur )) + [[ -n "$cur" && $a == ${cur}* ]] && \ + nomatch=false else - COMPREPLY+=( "" ) + joker=true fi done + $nomatch && $joker && \ + COMPREPLY+=( "" " " ) fi if [[ ${#COMPREPLY[@]} -ne 0 || -z "${_vyatta_op_allowed[*]}" ]] && [[ "${COMP_WORDS[*]}" == "${_vyatta_op_comp_words[*]}" ]] |