-
Notifications
You must be signed in to change notification settings - Fork 1
/
_pouf
592 lines (585 loc) · 17.7 KB
/
_pouf
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
#compdef pouf
autoload -U is-at-least
_pouf() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_pouf_commands" \
"*::: :->pouf" \
&& ret=0
case $state in
(pouf)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:pouf-command-$line[1]:"
case $line[1] in
(template)
_arguments "${_arguments_options[@]}" : \
'-i+[give an input template file (tera \: https\://tera.netlify.app/)]: :_files' \
'--input=[give an input template file (tera \: https\://tera.netlify.app/)]: :_files' \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(address.city)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(address.country)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(address.street)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(administrative.healthinsurrancecode)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(auto.licenseplate)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(barcode.isbn)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(color)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-d[give a fake hexadecimal color]' \
'--hexa[give a fake hexadecimal color]' \
'-r[give a fake rgb color]' \
'--rgb[give a fake rgb color]' \
'-a[give a fake rgba color]' \
'--rgba[give a fake rgba color]' \
'-t[give a fake hsl (tsl) color]' \
'--hsl[give a fake hsl (tsl) color]' \
'-l[give a fake hsla (tsl) color]' \
'--hsla[give a fake hsla (tsl) color]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(filesystem.mimetype)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(filesystem.semver)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-s[give exclusivly stable semver version (X.Y.Z)]' \
'--stable[give exclusivly stable semver version (X.Y.Z)]' \
'-u[give exclusivly unstable semver version (X-Y-Z-V.W)]' \
'--unstable[give exclusivly unstable semver version (X-Y-Z-V.W)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(finance.bic)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(http.code)
_arguments "${_arguments_options[@]}" : \
'-l+[give lang (ie\: fr_FR)]: :(fr fr_FR en)' \
'--lang=[give lang (ie\: fr_FR)]: :(fr fr_FR en)' \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(internet.ip)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-4[give exclusivly IPv4]' \
'--ipv4[give exclusivly IPv4]' \
'-6[give exclusivly IPv6]' \
'--ipv6[give exclusivly IPv6]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(internet.mac)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(internet.mail)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(internet.useragent)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(lorem.word)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(people.name)
_arguments "${_arguments_options[@]}" : \
'-l+[give lang (ie\: fr_FR)]: :(fr fr_FR en)' \
'--lang=[give lang (ie\: fr_FR)]: :(fr fr_FR en)' \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-t[give a fake name title]' \
'--title[give a fake name title]' \
'-w[give a fake name with her title]' \
'--with-title[give a fake name with her title]' \
'-f[give a fake firstname]' \
'--firstname[give a fake firstname]' \
'-z[give a fake lastname]' \
'--lastname[give a fake lastname]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(time.time)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(time.date)
_arguments "${_arguments_options[@]}" : \
'-n+[number of values]: : ' \
'--number=[number of values]: : ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_pouf__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:pouf-help-command-$line[1]:"
case $line[1] in
(template)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(address.city)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(address.country)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(address.street)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(administrative.healthinsurrancecode)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(auto.licenseplate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(barcode.isbn)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(color)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(filesystem.mimetype)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(filesystem.semver)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(finance.bic)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(http.code)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(internet.ip)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(internet.mac)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(internet.mail)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(internet.useragent)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(lorem.word)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(people.name)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(time.time)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(time.date)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
}
(( $+functions[_pouf_commands] )) ||
_pouf_commands() {
local commands; commands=(
'template:generate file with template' \
'address.city:give a city name (English only)' \
'address.country:give a country name and code (English only)' \
'address.street:give a street name (English only)' \
'administrative.healthinsurrancecode:give a Health insurrance code (French only)' \
'auto.licenseplate:give an automotive license plate (French only)' \
'barcode.isbn:give an isbn code' \
'color:give a fake color (hexadécimal, rgb, rgba, hsl and hsla representation)' \
'filesystem.mimetype:give a fake mime-type' \
'filesystem.semver:give a fake semver version' \
'finance.bic:give a fake BIC (Business Identifier Code)' \
'http.code:give a fake HTTP code' \
'internet.ip:give a fake IP (Internet Protocol)' \
'internet.mac:give a fake mac adress' \
'internet.mail:give a fake mail' \
'internet.useragent:give a fake user agent' \
'lorem.word:give a fake word (in Latin)' \
'people.name:give a fake name' \
'time.time:give a fake time' \
'time.date:give a fake date' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'pouf commands' commands "$@"
}
(( $+functions[_pouf__address.city_commands] )) ||
_pouf__address.city_commands() {
local commands; commands=()
_describe -t commands 'pouf address.city commands' commands "$@"
}
(( $+functions[_pouf__address.country_commands] )) ||
_pouf__address.country_commands() {
local commands; commands=()
_describe -t commands 'pouf address.country commands' commands "$@"
}
(( $+functions[_pouf__address.street_commands] )) ||
_pouf__address.street_commands() {
local commands; commands=()
_describe -t commands 'pouf address.street commands' commands "$@"
}
(( $+functions[_pouf__administrative.healthinsurrancecode_commands] )) ||
_pouf__administrative.healthinsurrancecode_commands() {
local commands; commands=()
_describe -t commands 'pouf administrative.healthinsurrancecode commands' commands "$@"
}
(( $+functions[_pouf__auto.licenseplate_commands] )) ||
_pouf__auto.licenseplate_commands() {
local commands; commands=()
_describe -t commands 'pouf auto.licenseplate commands' commands "$@"
}
(( $+functions[_pouf__barcode.isbn_commands] )) ||
_pouf__barcode.isbn_commands() {
local commands; commands=()
_describe -t commands 'pouf barcode.isbn commands' commands "$@"
}
(( $+functions[_pouf__color_commands] )) ||
_pouf__color_commands() {
local commands; commands=()
_describe -t commands 'pouf color commands' commands "$@"
}
(( $+functions[_pouf__filesystem.mimetype_commands] )) ||
_pouf__filesystem.mimetype_commands() {
local commands; commands=()
_describe -t commands 'pouf filesystem.mimetype commands' commands "$@"
}
(( $+functions[_pouf__filesystem.semver_commands] )) ||
_pouf__filesystem.semver_commands() {
local commands; commands=()
_describe -t commands 'pouf filesystem.semver commands' commands "$@"
}
(( $+functions[_pouf__finance.bic_commands] )) ||
_pouf__finance.bic_commands() {
local commands; commands=()
_describe -t commands 'pouf finance.bic commands' commands "$@"
}
(( $+functions[_pouf__help_commands] )) ||
_pouf__help_commands() {
local commands; commands=(
'template:generate file with template' \
'address.city:give a city name (English only)' \
'address.country:give a country name and code (English only)' \
'address.street:give a street name (English only)' \
'administrative.healthinsurrancecode:give a Health insurrance code (French only)' \
'auto.licenseplate:give an automotive license plate (French only)' \
'barcode.isbn:give an isbn code' \
'color:give a fake color (hexadécimal, rgb, rgba, hsl and hsla representation)' \
'filesystem.mimetype:give a fake mime-type' \
'filesystem.semver:give a fake semver version' \
'finance.bic:give a fake BIC (Business Identifier Code)' \
'http.code:give a fake HTTP code' \
'internet.ip:give a fake IP (Internet Protocol)' \
'internet.mac:give a fake mac adress' \
'internet.mail:give a fake mail' \
'internet.useragent:give a fake user agent' \
'lorem.word:give a fake word (in Latin)' \
'people.name:give a fake name' \
'time.time:give a fake time' \
'time.date:give a fake date' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'pouf help commands' commands "$@"
}
(( $+functions[_pouf__help__address.city_commands] )) ||
_pouf__help__address.city_commands() {
local commands; commands=()
_describe -t commands 'pouf help address.city commands' commands "$@"
}
(( $+functions[_pouf__help__address.country_commands] )) ||
_pouf__help__address.country_commands() {
local commands; commands=()
_describe -t commands 'pouf help address.country commands' commands "$@"
}
(( $+functions[_pouf__help__address.street_commands] )) ||
_pouf__help__address.street_commands() {
local commands; commands=()
_describe -t commands 'pouf help address.street commands' commands "$@"
}
(( $+functions[_pouf__help__administrative.healthinsurrancecode_commands] )) ||
_pouf__help__administrative.healthinsurrancecode_commands() {
local commands; commands=()
_describe -t commands 'pouf help administrative.healthinsurrancecode commands' commands "$@"
}
(( $+functions[_pouf__help__auto.licenseplate_commands] )) ||
_pouf__help__auto.licenseplate_commands() {
local commands; commands=()
_describe -t commands 'pouf help auto.licenseplate commands' commands "$@"
}
(( $+functions[_pouf__help__barcode.isbn_commands] )) ||
_pouf__help__barcode.isbn_commands() {
local commands; commands=()
_describe -t commands 'pouf help barcode.isbn commands' commands "$@"
}
(( $+functions[_pouf__help__color_commands] )) ||
_pouf__help__color_commands() {
local commands; commands=()
_describe -t commands 'pouf help color commands' commands "$@"
}
(( $+functions[_pouf__help__filesystem.mimetype_commands] )) ||
_pouf__help__filesystem.mimetype_commands() {
local commands; commands=()
_describe -t commands 'pouf help filesystem.mimetype commands' commands "$@"
}
(( $+functions[_pouf__help__filesystem.semver_commands] )) ||
_pouf__help__filesystem.semver_commands() {
local commands; commands=()
_describe -t commands 'pouf help filesystem.semver commands' commands "$@"
}
(( $+functions[_pouf__help__finance.bic_commands] )) ||
_pouf__help__finance.bic_commands() {
local commands; commands=()
_describe -t commands 'pouf help finance.bic commands' commands "$@"
}
(( $+functions[_pouf__help__help_commands] )) ||
_pouf__help__help_commands() {
local commands; commands=()
_describe -t commands 'pouf help help commands' commands "$@"
}
(( $+functions[_pouf__help__http.code_commands] )) ||
_pouf__help__http.code_commands() {
local commands; commands=()
_describe -t commands 'pouf help http.code commands' commands "$@"
}
(( $+functions[_pouf__help__internet.ip_commands] )) ||
_pouf__help__internet.ip_commands() {
local commands; commands=()
_describe -t commands 'pouf help internet.ip commands' commands "$@"
}
(( $+functions[_pouf__help__internet.mac_commands] )) ||
_pouf__help__internet.mac_commands() {
local commands; commands=()
_describe -t commands 'pouf help internet.mac commands' commands "$@"
}
(( $+functions[_pouf__help__internet.mail_commands] )) ||
_pouf__help__internet.mail_commands() {
local commands; commands=()
_describe -t commands 'pouf help internet.mail commands' commands "$@"
}
(( $+functions[_pouf__help__internet.useragent_commands] )) ||
_pouf__help__internet.useragent_commands() {
local commands; commands=()
_describe -t commands 'pouf help internet.useragent commands' commands "$@"
}
(( $+functions[_pouf__help__lorem.word_commands] )) ||
_pouf__help__lorem.word_commands() {
local commands; commands=()
_describe -t commands 'pouf help lorem.word commands' commands "$@"
}
(( $+functions[_pouf__help__people.name_commands] )) ||
_pouf__help__people.name_commands() {
local commands; commands=()
_describe -t commands 'pouf help people.name commands' commands "$@"
}
(( $+functions[_pouf__help__template_commands] )) ||
_pouf__help__template_commands() {
local commands; commands=()
_describe -t commands 'pouf help template commands' commands "$@"
}
(( $+functions[_pouf__help__time.date_commands] )) ||
_pouf__help__time.date_commands() {
local commands; commands=()
_describe -t commands 'pouf help time.date commands' commands "$@"
}
(( $+functions[_pouf__help__time.time_commands] )) ||
_pouf__help__time.time_commands() {
local commands; commands=()
_describe -t commands 'pouf help time.time commands' commands "$@"
}
(( $+functions[_pouf__http.code_commands] )) ||
_pouf__http.code_commands() {
local commands; commands=()
_describe -t commands 'pouf http.code commands' commands "$@"
}
(( $+functions[_pouf__internet.ip_commands] )) ||
_pouf__internet.ip_commands() {
local commands; commands=()
_describe -t commands 'pouf internet.ip commands' commands "$@"
}
(( $+functions[_pouf__internet.mac_commands] )) ||
_pouf__internet.mac_commands() {
local commands; commands=()
_describe -t commands 'pouf internet.mac commands' commands "$@"
}
(( $+functions[_pouf__internet.mail_commands] )) ||
_pouf__internet.mail_commands() {
local commands; commands=()
_describe -t commands 'pouf internet.mail commands' commands "$@"
}
(( $+functions[_pouf__internet.useragent_commands] )) ||
_pouf__internet.useragent_commands() {
local commands; commands=()
_describe -t commands 'pouf internet.useragent commands' commands "$@"
}
(( $+functions[_pouf__lorem.word_commands] )) ||
_pouf__lorem.word_commands() {
local commands; commands=()
_describe -t commands 'pouf lorem.word commands' commands "$@"
}
(( $+functions[_pouf__people.name_commands] )) ||
_pouf__people.name_commands() {
local commands; commands=()
_describe -t commands 'pouf people.name commands' commands "$@"
}
(( $+functions[_pouf__template_commands] )) ||
_pouf__template_commands() {
local commands; commands=()
_describe -t commands 'pouf template commands' commands "$@"
}
(( $+functions[_pouf__time.date_commands] )) ||
_pouf__time.date_commands() {
local commands; commands=()
_describe -t commands 'pouf time.date commands' commands "$@"
}
(( $+functions[_pouf__time.time_commands] )) ||
_pouf__time.time_commands() {
local commands; commands=()
_describe -t commands 'pouf time.time commands' commands "$@"
}
if [ "$funcstack[1]" = "_pouf" ]; then
_pouf "$@"
else
compdef _pouf pouf
fi