-
Notifications
You must be signed in to change notification settings - Fork 0
/
_ditz
29 lines (27 loc) · 826 Bytes
/
_ditz
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
#compdef ditz
ME=ditz
COMMANDS=--commands
OPTIONS='<options>'
if (($CURRENT == 2)); then
# We're completing the first word after the tool: the command.
_wanted command expl "$ME command" \
compadd -- $( "$ME" "$COMMANDS" )
else
# Find the options/files/URL/etc. for the current command by using the tool itself.
case "${words[$CURRENT]}"; in
-*)
_wanted args expl "Arguments for $ME ${words[2]}" \
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" ; _files )
;;
ht*|ft*)
_arguments '*:URL:_urls'
;;
/*|./*|\~*|../*)
_arguments '*:file:_files'
;;
*)
_wanted args expl "Arguments for $ME ${words[2]}" \
compadd -- $( "$ME" "${words[2]}" "$OPTIONS" )
;;
esac
fi