-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcompletions.zsh
93 lines (71 loc) · 1.54 KB
/
completions.zsh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#compdef spotify-next
function _sn() {
local -a cmds
cmds=(
'login:Log into Spotify'
'skip:Skip to next track without any changes'
'drop:Drop current track from the current playlist and skip to the next track'
'forward:Fast forward the current track by a percentage of its length (10% by default)'
'jump:Fast forward the current track to the next section'
'switch:Switch device (Spotify/Sonos)'
'move:Move song to playlist A'
's:alias for `skip`'
'd:alias for `drop`'
'f:alias for `forward`'
'j:alias for `jump`'
'w:alias for `switch`'
'm:alias for `move`'
'repl:Run application in interactive mode'
)
_arguments "1: :{_describe 'command' cmds}" '*:: :->args'
local help=( '--help[Display this help text.]' )
local version=( {--version,-v}'[Print the version number and exit.]' )
case $words[1] in
login)
_arguments -C $help
;;
drop)
_arguments -C $help
;;
skip)
_arguments -C $help
;;
forward)
_arguments -C $help
;;
jump)
_arguments -C $help
;;
move)
_arguments -C $help
;;
switch)
_arguments -C $help
;;
s)
_arguments -C $help
;;
d)
_arguments -C $help
;;
f)
_arguments -C $help
;;
j)
_arguments -C $help
;;
w)
_arguments -C $help
;;
m)
_arguments -C $help
;;
repl)
_arguments -C $help
;;
*)
_arguments -C $help $version
;;
esac
}
_sn "$@"