aboutsummaryrefslogtreecommitdiffstats
path: root/completions/rsp.elvish
blob: 54ccdfecea0d2d3019714dbdabed15a5d27676fa (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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
use builtin;
use str;

set edit:completion:arg-completer[rsp] = {|@words|
    fn spaces {|n|
        builtin:repeat $n ' ' | str:join ''
    }
    fn cand {|text desc|
        edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
    }
    var command = 'rsp'
    for word $words[1..-1] {
        if (str:has-prefix $word '-') {
            break
        }
        set command = $command';'$word
    }
    var completions = [
        &'rsp'= {
            cand -h 'Print help'
            cand --help 'Print help'
            cand start-daemon 'Start the daemon'
            cand stop-daemon 'Stop the daemon'
            cand restart 'Restart the daemon (kill existing and start new)'
            cand play 'Play a track, album, or artist'
            cand pause 'Pause playback'
            cand resume 'Resume playback'
            cand toggle 'Toggle play/pause'
            cand stop 'Stop playback'
            cand next 'Skip to next track'
            cand previous 'Skip to previous track'
            cand volume 'Set volume (0-100)'
            cand shuffle 'Shuffle mode'
            cand queue 'Queue management'
            cand status 'Show player status'
            cand scan 'Scan music paths to populate database'
            cand settings 'Settings management'
            cand completions 'Generate shell completions (developer only)'
            cand help 'Print this message or the help of the given subcommand(s)'
        }
        &'rsp;start-daemon'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;stop-daemon'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;restart'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;play'= {
            cand -i 'Add after current track and skip to it'
            cand --now 'Add after current track and skip to it'
            cand -n 'Add to queue after current track (don''t skip)'
            cand --next 'Add to queue after current track (don''t skip)'
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;pause'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;resume'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;toggle'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;stop'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;next'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;previous'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;volume'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;shuffle'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;queue'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;status'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;scan'= {
            cand --paths 'paths'
            cand --force 'force'
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;settings'= {
            cand -h 'Print help'
            cand --help 'Print help'
            cand get 'Get a setting value'
            cand set 'Set a setting value'
            cand list 'List all settings'
            cand unset 'Unset a setting'
            cand help 'Print this message or the help of the given subcommand(s)'
        }
        &'rsp;settings;get'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;settings;set'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;settings;list'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;settings;unset'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;settings;help'= {
            cand get 'Get a setting value'
            cand set 'Set a setting value'
            cand list 'List all settings'
            cand unset 'Unset a setting'
            cand help 'Print this message or the help of the given subcommand(s)'
        }
        &'rsp;settings;help;get'= {
        }
        &'rsp;settings;help;set'= {
        }
        &'rsp;settings;help;list'= {
        }
        &'rsp;settings;help;unset'= {
        }
        &'rsp;settings;help;help'= {
        }
        &'rsp;completions'= {
            cand -h 'Print help'
            cand --help 'Print help'
        }
        &'rsp;help'= {
            cand start-daemon 'Start the daemon'
            cand stop-daemon 'Stop the daemon'
            cand restart 'Restart the daemon (kill existing and start new)'
            cand play 'Play a track, album, or artist'
            cand pause 'Pause playback'
            cand resume 'Resume playback'
            cand toggle 'Toggle play/pause'
            cand stop 'Stop playback'
            cand next 'Skip to next track'
            cand previous 'Skip to previous track'
            cand volume 'Set volume (0-100)'
            cand shuffle 'Shuffle mode'
            cand queue 'Queue management'
            cand status 'Show player status'
            cand scan 'Scan music paths to populate database'
            cand settings 'Settings management'
            cand completions 'Generate shell completions (developer only)'
            cand help 'Print this message or the help of the given subcommand(s)'
        }
        &'rsp;help;start-daemon'= {
        }
        &'rsp;help;stop-daemon'= {
        }
        &'rsp;help;restart'= {
        }
        &'rsp;help;play'= {
        }
        &'rsp;help;pause'= {
        }
        &'rsp;help;resume'= {
        }
        &'rsp;help;toggle'= {
        }
        &'rsp;help;stop'= {
        }
        &'rsp;help;next'= {
        }
        &'rsp;help;previous'= {
        }
        &'rsp;help;volume'= {
        }
        &'rsp;help;shuffle'= {
        }
        &'rsp;help;queue'= {
        }
        &'rsp;help;status'= {
        }
        &'rsp;help;scan'= {
        }
        &'rsp;help;settings'= {
            cand get 'Get a setting value'
            cand set 'Set a setting value'
            cand list 'List all settings'
            cand unset 'Unset a setting'
        }
        &'rsp;help;settings;get'= {
        }
        &'rsp;help;settings;set'= {
        }
        &'rsp;help;settings;list'= {
        }
        &'rsp;help;settings;unset'= {
        }
        &'rsp;help;completions'= {
        }
        &'rsp;help;help'= {
        }
    ]
    $completions[$command]
}