forked from sferik/t-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht-completion.zsh
426 lines (373 loc) · 12.9 KB
/
t-completion.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
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
#compdef t
# Completion for Zsh. Source from somewhere in your $fpath.
_t (){
local -a t_general_options
t_general_options=("(-H --host)"{-H,--host=}"[Twitter API server]:URL:_urls"
"(-C --color)"{-C,--color}"[Control how color is used in output]"
"(-U --no-ssl)"{-U,--no-ssl}"[Disable SSL]"
"(-P --profile)"{-P,--profile=}"[Path to RC file]:file:_files"
$nul_arg
)
if (( CURRENT > 2 )); then
(( CURRENT-- ))
shift words
_call_function 1 _t_${words[1]}
else
_values "t command" \
"accounts[List accounts]" \
"authorize[Allows an application to request user authorization]" \
"block[Block users.]" \
"direct_messages[Returns the 20 most recent Direct Messages sent to you.]" \
"direct_messages_sent[Returns the 20 most recent Direct Messages you\'ve sent.]" \
"groupies[Returns the list of people who follow you but you don\'t follow back.]" \
"dm[Sends that person a Direct Message.]" \
"does_contain[Find out whether a list contains a user.]" \
"does_follow[Find out whether one user follows another.]" \
"favorite[Marks Tweets as favorites.]" \
"favorites[Returns the 20 most recent Tweets you favorited.]" \
"follow[Allows you to start following users.]" \
"followings[Returns a list of the people you follow on Twitter.]" \
"followers[Returns a list of the people who follow you on Twitter.]" \
"friends[Returns the list of people who you follow and follow you back.]" \
"leaders[Returns the list of people who you follow but don\'t follow you back.]" \
"lists[Returns the lists created by a user.]" \
"matrix[Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.]" \
"mentions[Returns the 20 most recent Tweets mentioning you.]" \
"open[Opens that user\'s profile in a web browser.]" \
"reply[Post your Tweet as a reply directed at another person.]" \
"report_spam[Report users for spam.]" \
"retweet[Sends Tweets to your followers.]" \
"retweets[Returns the 20 most recent Retweets by a user.]" \
"ruler[Prints a 140-character ruler]" \
"status[Retrieves detailed information about a Tweet.]" \
"timeline[Returns the 20 most recent Tweets posted by a user.]" \
"trends[Returns the top 10 trending topics.]" \
"trend_locations[Returns the locations for which Twitter has trending topic information.]" \
"unfollow[Allows you to stop following users.]" \
"update[Post a Tweet.]" \
"users[Returns a list of users you specify.]" \
"version[Show version.]" \
"whois[Retrieves profile information for the user.]" \
"delete[Delete Tweets, Direct Messages, etc.]" \
"list[Do various things with lists.]" \
"search[Search through Tweets.]" \
"set[Change various account settings.]" \
"stream[Commands for streaming Tweets.]" \
fi
}
_t_accounts() {
_arguments \
$t_general_options && ret=0
}
_t_authorize() {
_arguments \
"(-d --display-url)"{-d,--display-url}"[Display the authorization URL instead of attempting to open it.]" \
$t_general_options && ret=0
}
_t_block() {
_arguments \
"(-i --id)"{-i,--id}"[Specify input as Twitter user IDs instead of screen names.]" \
$t_general_options && ret=0
}
_t_direct_messages() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
$t_general_options && ret=0
}
_t_direct_messages_sent() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
$t_general_options && ret=0
}
_t_groupies() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_dm() {
_arguments \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
$t_general_options && ret=0
}
_t_does_contain() {
_arguments \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
$t_general_options && ret=0
}
_t_does_follow() {
_arguments \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
$t_general_options && ret=0
}
_t_favorite() {
_arguments \
$t_general_options && ret=0
}
_t_favorites() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
$t_general_options && ret=0
}
_t_follow() {
_arguments \
"(-i --id)"{-i,--id}"[Specify input as Twitter user IDs instead of screen names.]" \
$t_general_options && ret=0
}
_t_followings() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_followers() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_friends() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_leaders() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_lists() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_matrix() {
_arguments \
$t_general_options && ret=0
}
_t_mentions() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
$t_general_options && ret=0
}
_t_open() {
_arguments \
"(-d --display-url)"{-d,--display-url}"[Display the requested URL instead of attempting to open it.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-s --status)"{-s,--status}"[Specify input as a Twitter status ID instead of a screen name.]" \
$t_general_options && ret=0
}
_t_reply() {
_arguments \
"(-a --all)"{-a,--all}"[Reply to all users mentioned in the Tweet.]" \
"(-l --location)"{-l,--location}"[]" \
$t_general_options && ret=0
}
_t_report_spam() {
_arguments \
"(-i --id)"{-i,--id}"[Specify input as Twitter user IDs instead of screen names.]" \
$t_general_options && ret=0
}
_t_retweet() {
_arguments \
$t_general_options && ret=0
}
_t_retweets() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
$t_general_options && ret=0
}
_t_ruler() {
_arguments \
"(-i --indent)"{-i,--indent}"[The number of space to print before the ruler.]" \
$t_general_options && ret=0
}
_t_status() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
$t_general_options && ret=0
}
_t_timeline() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-e --exclude)"{-e,--exclude}"[Exclude certain types of Tweets from the results.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-m --max_id)"{-m,--max_id}"[Returns only the results with an ID less than the specified ID.]" \
"(-n --number)"{-n,--number}"[Limit the number of results.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --since_id)"{-s,--since_id}"[Returns only the results with an ID greater than the specified ID.]" \
$t_general_options && ret=0
}
_t_trends() {
_arguments \
"(-x --exclude-hashtags)"{-x,--exclude-hashtags}"[Remove all hashtags from the trends list.]" \
$t_general_options && ret=0
}
_t_trend_locations() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_unfollow() {
_arguments \
"(-i --id)"{-i,--id}"[Specify input as Twitter user IDs instead of screen names.]" \
$t_general_options && ret=0
}
_t_update() {
_arguments \
"(-l --location)"{-l,--location}"[]" \
"(-f --file)"{-f,--file}"[The path to an image to attach to your tweet.]" \
$t_general_options && ret=0
}
_t_users() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify input as Twitter user IDs instead of screen names.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
"(-r --reverse)"{-r,--reverse}"[Reverse the order of the sort.]" \
"(-s --sort)"{-s,--sort}"[Specify the order of the results.]" \
"(-u --unsorted)"{-u,--unsorted}"[Output is not sorted.]" \
$t_general_options && ret=0
}
_t_version() {
_arguments \
$t_general_options && ret=0
}
_t_whois() {
_arguments \
"(-c --csv)"{-c,--csv}"[Output in CSV format.]" \
"(-i --id)"{-i,--id}"[Specify user via ID instead of screen name.]" \
"(-l --long)"{-l,--long}"[Output in long format.]" \
$t_general_options && ret=0
}
__t_delete_arguments() {
_args=(block
dm
favorite
list
status
help
)
compadd "$@" -k _args
}
__t_list_arguments() {
_args=(add
create
information
members
remove
timeline
help
)
compadd "$@" -k _args
}
__t_search_arguments() {
_args=(all
favorites
list
mentions
retweets
timeline
users
help
)
compadd "$@" -k _args
}
__t_set_arguments() {
_args=(active
bio
language
location
name
profile_background_image
profile_image
url
help
)
compadd "$@" -k _args
}
__t_stream_arguments() {
_args=(all
matrix
search
timeline
users
help
)
compadd "$@" -k _args
}
_t_delete() {
_arguments \
":argument:__t_delete_arguments" \
$t_general_options && ret=0
}
_t_list() {
_arguments \
":argument:__t_list_arguments" \
$t_general_options && ret=0
}
_t_search() {
_arguments \
":argument:__t_search_arguments" \
$t_general_options && ret=0
}
_t_set() {
_arguments \
":argument:__t_set_arguments" \
$t_general_options && ret=0
}
_t_stream() {
_arguments \
":argument:__t_stream_arguments" \
$t_general_options && ret=0
}