-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_dewi
46 lines (36 loc) · 982 Bytes
/
_dewi
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
35
36
37
38
39
40
41
42
43
44
45
46
#compdef dewi
function __dewi-nothing-else() {
_message "no further arguments"
}
function _dewi-add() {
_path_files -g '*(/-)'
}
function _dewi-init() {
__dewi-nothing-else
}
function _dewi-update() {
__dewi-nothing-else
}
function _dewi() {
local curcontext="${curcontext}"
local state ret dewicommand
local -a args
args=(
#'-v[request verbose output]'
#...no options as of now.
'*:: :->subcommand_or_options'
)
_arguments -C -s -w ${args} && return
if [[ ${state} == "subcommand_or_options" ]]; then
if (( CURRENT == 1 )) ; then
_describe -t subcommands 'dewi commands' _dewi_operations
else
dewicommand="${words[1]}"
curcontext="${curcontext%:*:*}:dewi-${dewicommand}:"
_call_function ret _dewi-${dewicommand}
fi
fi
}
typeset -ga _dewi_operations
_dewi_operations=( ${(f)"$(command dewi completion operations)"} )
_dewi "$@"