diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:02:44 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:02:44 +0000 |
commit | c789f5dbdb5e05a7e47b3cd06f3386dfddb438ca (patch) | |
tree | 1874a295b9bf3cc47a0b6a83e5badcf82652676a /Completion/Base | |
parent | ac5b2891754453bdd617a94c8d70e974def016bd (diff) | |
download | zsh-c789f5dbdb5e05a7e47b3cd06f3386dfddb438ca.tar.gz zsh-c789f5dbdb5e05a7e47b3cd06f3386dfddb438ca.tar.xz zsh-c789f5dbdb5e05a7e47b3cd06f3386dfddb438ca.zip |
moved from Completion/Core/_all_labels
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/Core/_all_labels | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Completion/Base/Core/_all_labels b/Completion/Base/Core/_all_labels new file mode 100644 index 000000000..8665f5bf3 --- /dev/null +++ b/Completion/Base/Core/_all_labels @@ -0,0 +1,43 @@ +#autoload + +local __gopt=-J __len __tmp __pre __suf __ret=1 __descr __spec __prev + +if [[ "$1" = - ]]; then + __prev=- + shift +fi + +if [[ "$1" = -([12]|)[VJ] ]]; then + __gopt="$1" + shift +fi + +__tmp=${argv[(ib:4:)-]} +__len=$# +if [[ __tmp -lt __len ]]; then + __pre=$(( __tmp-1 )) + __suf=$__tmp +elif [[ __tmp -eq $# ]]; then + __pre=-2 + __suf=$(( __len+1 )) +else + __pre=4 + __suf=5 +fi + +while comptags "-A$__prev" "$1" curtag __spec; do + _comp_tags="$_comp_tags $__spec " + if [[ "$curtag" = *[^\\]:* ]]; then + zformat -f __descr "${curtag#*:}" "d:$3" + _description "$__gopt" "${curtag%:*}" "$2" "$__descr" + curtag="${curtag%:*}" + + "$4" "${(P@)2}" "${(@)argv[5,-1]}" && __ret=0 + else + _description "$__gopt" "$curtag" "$2" "$3" + + "${(@)argv[4,__pre]}" "${(P@)2}" "${(@)argv[__suf,-1]}" && __ret=0 + fi +done + +return __ret |