blob: 446fb2a904b09e7223b674143fb0f262a774583f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#compdef -k complete-word \C-xh
_complete_help() {
local _sort_tags=_help_sort_tags text i
typeset -A help_tags
typeset -U help_contexts
help_contexts=()
compadd() { return 1 }
_main_complete
unfunction compadd
for i in "$help_contexts[@]"; do
text="${text}
tags in context \`${i}': ${help_tags[$i]}"
done
compstate[list]='list force'
compstate[insert]=''
compadd -UX "$text[2,-1]" -n ''
}
_help_sort_tags() {
help_contexts=( "$help_contexts[@]" "$curcontext" )
help_tags[$curcontext]="${help_tags[$curcontext]}
${argv}"
comptry "$@"
}
_complete_help "$@"
|