archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-hatch / trunk / hatch_complete.zsh
blob33d3ae350f5cc3ba3793a8f579fd3014b09055dd
1 _hatch_completion() {
2 local -a completions
3 local -a completions_with_descriptions
4 local -a response
5 response=("${(@f)$( env COMP_WORDS="${words[*]}" \
6 COMP_CWORD=$((CURRENT-1)) \
7 _HATCH_COMPLETE="complete_zsh" \
8 hatch )}")
10 for key descr in ${(kv)response}; do
11 if [[ "$descr" == "_" ]]; then
12 completions+=("$key")
13 else
14 completions_with_descriptions+=("$key":"$descr")
16 done
18 if [ -n "$completions_with_descriptions" ]; then
19 _describe -V unsorted completions_with_descriptions -U -Q
22 if [ -n "$completions" ]; then
23 compadd -U -V unsorted -Q -a completions
25 compstate[insert]="automenu"
28 compdef _hatch_completion hatch;