File: commands.yaml

package info (click to toggle)
crazy-complete 0.3.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,528 kB
  • sloc: python: 13,342; sh: 995; makefile: 68
file content (1072 lines) | stat: -rw-r--r-- 27,342 bytes parent folder | download
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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
command: 'none'
category: 'meta'
short: 'No completion, but specifies that an argument is required'
long: |
  Disables autocompletion for an option but still marks it as requiring an argument.
  
  Without specifying `complete`, the option would not take an argument.
definition: |
  prog: "example"
  options:
    - option_strings: ["--none"]
      complete: ["none"]
output: |
  ~ > example --none=<TAB>
  <NO OUTPUT>

---

command: 'prefix'
category: 'meta'
synopsis: |
  ["prefix", <PREFIX>, <COMPLETER>]
short: 'Prefix completion by a string'
long: |
  The first argument is the prefix that should be used.

  The second argument is a completer.
definition: |
  prog: "example"
  options:
    - option_strings: ["--prefix"]
      complete: ["prefix", "input:", ['file']]
output: |
  ~ > example --prefix=<TAB>
  ~ > example --prefix=input:

  ~ > example --prefix=input:<TAB>
  ~ > example --prefix=input:file1.txt

---

command: 'combine'
synopsis: |
  ["combine", [<COMPLETER>, <COMPLETER>, ...]]
category: 'meta'
short: 'Combine multiple completers'
long: |
  With `combine` multiple completers can be combined into one.

  It takes a list of completers as its argument.
definition: |
  prog: "example"
  options:
    - option_strings: ["--combine"]
      complete: ["combine", [["user"], ["pid"]]]
output: |
  ~ > example --user-list=avahi,daemon,<TAB>
  1439404  3488332  3571716           3607235                 4134206
  alpm     avahi    bin               braph                   daemon
  root     rtkit    systemd-coredump  systemd-journal-remote  systemd-network
  [...]

---

command: 'list'
short: 'Complete a comma-separated list of any completer'
synopsis: |
  ["list", <COMPLETER>]
  
  ["list", <COMPLETER>, <OPTIONS>]
category: 'meta'
long: |
  The separator can be changed by adding `{"separator": ...}`.
  
  By default, duplicate values are not offered for completion. This can be changed by adding `{"duplicates": true}`.
also:
  value_list: "For completing a comma-separated list of values"
  file_list: "For completing a comma-separated list of files"
  directory_list: "For completing a comma-separated list of directories"
  key_value_list: "For completing a comma-separated list of key=value pairs"
definition: |
  prog: "example"
  options:
    - option_strings: ["--user-list"]
      complete: ["list", ["user"]]
    - option_strings: ["--option-list"]
      complete: ["list", ["choices", ["setuid", "async", "block"]], {"separator": ":"}]
output: |
  ~ > example --user-list=avahi,daemon,<TAB>
  bin                     braph
  colord                  dbus
  dhcpcd                  git

---

command: 'key_value_list'
category: 'meta'
synopsis: |
  ["key_value_list", <PAIR_SEPARATOR>, <VALUE_SEPARATOR>, [<DEFINITION...>]]
short: 'Complete a comma-separated list of key=value pairs'
long: |
  The first argument is the separator used for delimiting the key-value pairs.
  
  The second argument is the separator used for delimiting the value from the key.
  
  The third argument is a list of key-description-completer definitions, like:
  
    `[ [<key>, <description>, <completer>], ... ]`
  
  If a key does not take an argument, use `null` as completer.
  
  If a key does take an argument but cannot be completed, use `['none']` as completer.
also:
  list: "For completing a comma-separated list of any completer"
  value_list: "For completing a comma-separated list of values"
definition: |
  prog: "example"
  options:
    - option_strings: ["--key-value-list"]
      complete: ["key_value_list", ",", "=", [
        ['flag',   'An option flag', null],
        ['nodesc', null, null],
        ['nocomp', 'An option with arg but without completer', ['none']],
        ['user',   'Takes a username',  ['user']],
        ['check',  'Specify file name conversions', ['choices', {
          'relaxed': "convert to lowercase before lookup",
          'strict': "no conversion"
        }]]
      ]]
output: |
  ~ > example --key-value-list flag,user=<TAB>
  bin                     braph
  colord                  dbus
  dhcpcd                  git

---

command: 'integer'
category: 'basic'
synopsis: |
  ["integer"]
  
  ["integer", <OPTIONS>]
short: 'Complete an integer'
long: |
  A min value can be specified by using `{"min": <VALUE>}`.
  
  A max value can be specified by using `{"max": <VALUE>}`.
  
  A list of suffixes can be specified by using `{"suffixes": {"<SUFFIX>": "<DESCRIPTION", ...}}`

  A help text can be set by using `{"help": "<TEXT>"}`. If not supplied, the `help` attribute of the option is used.
also:
  float: "For completing a floating point number"
  range: "For completing a range of integers"
definition: |
  prog: "example"
  options:
    - option_strings: ["--time"]
      complete: ["integer", {"suffixes": {"s": "seconds", "m": "minutes", "h": "hours"}}]
output: |
  ~ > example --integer=3<TAB>
  s -- seconds  m -- minutes  h -- hours

---

command: 'float'
category: 'basic'
synopsis: |
  ["float"]
  
  ["float", <OPTIONS>]
short: 'Complete a floating point number'
long: |
  A min value can be specified by using `{"min": <VALUE>}`.
  
  A max value can be specified by using `{"max": <VALUE>}`.
  
  A list of suffixes can be specified by using `{"suffixes": {"<SUFFIX>": "<DESCRIPTION", ...}}`

  A help text can be set by using `{"help": "<TEXT>"}`. If not supplied, the `help` attribute of the option is used.
also:
  integer: "For completing an integer"
definition: |
  prog: "example"
  options:
    - option_strings: ["--time"]
      complete: ["float", {"suffixes": {"s": "seconds", "m": "minutes", "h": "hours"}}]
output: |
  ~ > example --time=3.0<TAB>
  s -- seconds  m -- minutes  h -- hours

---

command: 'file'
category: 'basic'
synopsis: |
  ["file"]
  
  ["file", <OPTIONS>]
short: 'Complete a file'
long: |
  You can restrict completion to a specific directory by adding `{"directory": ...}`.
   
  You can restrict completion to specific extensions by adding `{"extensions": [...]}`.
   
  You can make matching extensions *fuzzy* by adding `{"fuzzy": true}`.
  Fuzzy means that the files do not have to end with the exact extension. For example `foo.txt.1`.
  
  You can ignore files by adding a list of Bash globs using `{"ignore_globs": [...]}`
  
  **NOTE:** Restricting completion to specific file extensions only makes sense if the program being completed actually expects files of those types.
  On Unix-like systems, file extensions generally have no inherent meaning -- they are purely conventional and not required for determining file types.
also:
  file_list: 'For completing a comma-separated list of files'
  mime_file: "For completing a file based on it's MIME-type"
definition: |
  prog: "example"
  options:
    - option_strings: ["--file"]
      complete: ["file"]
  
    - option_strings: ["--file-tmp"]
      complete: ["file", {"directory": "/tmp"}]
  
    - option_strings: ["--file-ext"]
      complete: ["file", {"extensions": ["c", "cpp"]}]
  
    - option_strings: ["--file-ignore"]
      complete: ["file", {"ignore_globs": ["*.[tT][xX][tT]", "*.c++"]}]
output: |
   ~ > example --file=<TAB>
   dir1/  dir2/  file1  file2
   ~ > example --file-ext=<TAB>
   dir1/  dir2/  file.c  file.cpp

---

command: 'directory'
category: 'basic'
synopsis: |
  ["directory"]
  
  ["directory", <OPTIONS>]
short: 'Complete a directory'
long: |
  You can restrict completion to a specific directory by adding `{"directory": ...}`.
also:
  directory_list: 'For completing a comma-separated list of directories'
definition: |
  prog: "example"
  options:
    - option_strings: ["--directory"]
      complete: ["directory"]
    - option_strings: ["--directory-tmp"]
      complete: ["directory", {"directory": "/tmp"}]
output: |
   ~ > example --directory=<TAB>
   dir1/  dir2/

---

command: 'file_list'
category: 'basic'
synopsis: |
  ["file_list"]
  
  ["file_list", <OPTIONS>]
short: 'Complete a comma-separated list of files'
long: |
  This is an alias for `['list', ['file']]`.
  
  You can restrict completion to a specific directory by adding `{"directory": ...}`.
  
  You can restrict completion to specific extensions by adding `{"extensions": [...]}`.
  
  You can make matching extensions *fuzzy* by adding `{"fuzzy": true}`.
  Fuzzy means that the files do not have to end with the exact extension. For example `foo.txt.1`.
  
  You can ignore files by adding a list of Bash globs using `{"ignore_globs": [...]}`
  
  By default, duplicate values are not offered for completion. This can be changed by adding `{"duplicates": true}`.
  
  The separator can be changed by adding `{"separator": ...}`
also:
  list: 'For completing a comma-separted list using any completer'
  file: 'For completing a file'
  directory_list: 'For completing a comma-separated list of directories'
definition: |
  prog: "example"
  options:
    - option_strings: ["--file-list"]
      complete: ["file_list"]
output: |
   ~ > example --file-list=file1,file2,<TAB>
   file3  file4

---

command: 'directory_list'
category: 'basic'
synopsis: |
  ["directory_list"]
  
  ["directory_list", <OPTIONS>]
short: 'Complete a comma-separated list of directories'
long: |
  This is an alias for `['list', ['directory']]`.

  You can restrict completion to a specific directory by adding `{"directory": ...}`.
   
  The separator can be changed by adding `{"separator": ...}`
   
  By default, duplicate values are not offered for completion. This can be changed by adding `{"duplicates": true}`.
also:
  list: 'For completion a comma-separated list of any completer'
  directory: 'For completing a directory'
  file_list: 'For completing a comma-separated list of files'
definition: |
  prog: "example"
  options:
    - option_strings: ["--directory-list"]
      complete: ["directory_list"]
output: |
   ~ > example --directory-list=directory1,directory2,<TAB>
   directory3  directory4

---

command: 'mime_file'
category: 'basic'
synopsis: |
  ["mime_file", <MIME_REGEX>]
short: "Complete a file based on it's MIME-type"
long: |
  This completer takes an extended regex passed to `grep -E` to filter the results.
definition: |
  prog: "example"
  options:
    - option_strings: ["--image"]
      complete: ["mime_file", 'image/']
output: |
   ~ > example --image=<TAB>
   dir1/  dir2/  img.png  img.jpg

---

command: 'choices'
category: 'basic'
synopsis: |
  ["choices", <ITEMS>]
short: 'Complete from a set of words'
long: |
  Items can be a list or a dictionary.
   
  If a dictionary is supplied, the keys are used as items and the values are used
  as description.
notes:
  - "If the completion suggestions should appear in their original order, set `nosort` to `true`"
definition: |
  prog: "example"
  options:
    - option_strings: ["--choices-1"]
      complete: ["choices", ["Item 1", "Item 2"]]
  
    - option_strings: ["--choices-2"]
      complete: ["choices", {"Item 1": "Description 1", "Item 2": "Description 2"}]
  
    - option_strings: ["--choices-keep-order"]
      complete: ["choices", ["zebra", "cat", "monkey"]]
      nosort: true
output: |
  ~ > example --choices-2=<TAB>
  Item 1  (Description 1)  Item 2  (Description 2)

---

command: 'value_list'
category: 'basic'
synopsis: |
  ["value_list", <OPTIONS>]
short: 'Complete a comma-separated list of values'
long: |
  Complete one or more items from a list of items. Similar to `mount -o`.
   
  Arguments are supplied by adding `{"values": ...}`.
   
  A separator can be supplied by adding `{"separator": ...}` (the default is `","`).
   
  By default, duplicate values are not offered for completion. This can be changed by adding `{"duplicates": true}`.
also:
  list: "For completing a comma-separated list of any completer"
  key_value_list: "For completing a comma-separated list of key=value pairs"
definition: |
  prog: "example"
  options:
    - option_strings: ["--value-list-1"]
      complete: ["value_list", {"values": ["exec", "noexec"]}]
    - option_strings: ["--value-list-2"]
      complete: ["value_list", {"values": {"one": "Description 1", "two": "Description 2"}}]
output: |
  ~ > example --value-list-1=<TAB>
  exec    noexec
  ~ > example --value-list-1=exec,<TAB>
  noexec
  ~ > example --value-list-2=<TAB>
  one  -- Description 1
  two  -- Description 2

---

command: 'exec'
category: 'custom'
synopsis: |
  ["exec", <COMMAND>]
short: 'Complete by the output of a command or function'
long: |
  The output must be in form of:

  ```
  <item_1>\t<description_1>\n
  <item_2>\t<description_2>\n
  [...]
  ```
  
  An item and its description are delimited by a tabulator.
   
  These pairs are delimited by a newline.
also:
  exec_fast: "Faster implementation of exec"
notes:
  - "Functions can be put inside a file and included with `--include-file`"
definition: |
  prog: "example"
  options:
    - option_strings: ["--exec"]
      complete: ["exec", "printf '%s\\t%s\\n' 'Item 1' 'Description 1' 'Item 2' 'Description 2'"]
output: |
  ~ > example --exec=<TAB>
  Item 1  (Description 1)  Item 2  (Description 2)

---

command: 'exec_fast'
category: 'custom'
synopsis: |
  ["exec_fast", <COMMAND>]
short: 'Complete by the output of a command or function (fast and unsafe)'
long: |
  Faster version of exec for handling large amounts of data.
   
  This implementation requires that the items of the parsed output do not include
  special shell characters or whitespace.
notes:
  - "Functions can be put inside a file and included with `--include-file`"
definition: |
  prog: "example"
  options:
    - option_strings: ["--exec-fast"]
      complete: ["exec_fast", "printf '%s\\t%s\\n' 1 one 2 two"]
output: |
  ~ > example --exec-internal=<TAB>
  1  -- one
  2  -- one

---

command: 'exec_internal'
category: 'custom'
synopsis: |
  ["exec_internal", <COMMAND>]
short: "Complete by a function that uses the shell's internal completion mechanisms"
long: |
  Execute a function that internally modifies the completion state.
  
  This is useful if a more advanced completion is needed.
  
  For **Bash**, it might look like:
  
  ```sh
  my_completion_func() {
      COMPREPLY=( $(compgen -W "read write append" -- "$cur") )
  }
  ```
  
  For **Zsh**, it might look like:
  
  ```sh
  my_completion_func() {
      local items=(
          read:'Read data from a file'
          write:'Write data from a file'
          append:'Append data to a file'
      )
  
      _describe 'my items' items
  }
  ```
  
  For **Fish**, it might look like:
  
  ```sh
  function my_completion_func
      printf '%s\t%s\n' \
          read 'Read data from a file'  \
          write 'Write data from a file' \
          append 'Append data to a file'
  end
  ```
notes:
  - "Functions can be put inside a file and included with `--include-file`"
definition: |
  prog: "example"
  options:
    - option_strings: ["--exec-internal"]
      complete: ["exec_internal", "my_completion_func"]
output: |
  ~ > example --exec-internal=<TAB>
  append  -- Append data to a file
  read    -- Read data from a file
  write   -- Write data from a file

---

command: 'range'
category: 'basic'
synopsis: |
  ["range", <START>, <STOP>]
  
  ["range", <START>, <STOP>, <STEP>]
short: 'Complete a range of integers'
definition: |
  prog: "example"
  options:
    - option_strings: ["--range-1"]
      complete: ["range", 1, 9]
    - option_strings: ["--range-2"]
      complete: ["range", 1, 9, 2]
output: |
  ~ > example --range-1=<TAB>
  1  2  3  4  5  6  7  8  9
  ~ > example --range-2=<TAB>
  1  3  5  7  9

---

command: 'signal'
category: 'basic'
short: 'Complete signal names'
definition: |
  prog: "example"
  options:
    - option_strings: ["--signal"]
      complete: ["signal"]
output: |
  ~ > example --signal=<TAB>
  ABRT    -- Process abort signal
  ALRM    -- Alarm clock
  BUS     -- Access to an undefined portion of a memory object
  CHLD    -- Child process terminated, stopped, or continued
  CONT    -- Continue executing, if stopped
  FPE     -- Erroneous arithmetic operation
  HUP     -- Hangup
  ILL     -- Illegal instruction
  INT     -- Terminal interrupt signal
  [...]

---

command: 'hostname'
category: 'basic'
short: 'Complete a hostname'
definition: |
  prog: "example"
  options:
    - option_strings: ["--hostname"]
      complete: ["hostname"]
output: |
  ~ > example --hostname=<TAB>
  localhost

---

command: 'process'
category: 'basic'
short: 'Complete a process name'
also:
  pid: 'For completing a PID'
definition: |
  prog: "example"
  options:
    - option_strings: ["--process"]
      complete: ["process"]
output: |
  ~ > example --process=s<TAB>
  scsi_eh_0         scsi_eh_1       scsi_eh_2      scsi_eh_3  scsi_eh_4
  scsi_eh_5         sh              sudo           syndaemon  systemd
  systemd-journald  systemd-logind  systemd-udevd

---

command: 'pid'
category: 'basic'
short: 'Complete a PID'
also:
  process: 'For completing a process name'
definition: |
  prog: "example"
  options:
    - option_strings: ["--pid"]
      complete: ["pid"]
output: |
  ~ > example --pid=<TAB>
  1       13      166     19      254     31      45
  1006    133315  166441  19042   26      32      46
  10150   1392    166442  195962  27      33      4609

---

command: 'filesystem_type'
category: 'basic'
short: 'Complete a filesystem type'
definition: |
  prog: "example"
  options:
    - option_strings: ["--filesystem-type"]
      complete: ["filesystem_type"]
output: |
  ~ > example --filesystem-type=<TAB>
  adfs     autofs   bdev      bfs     binder     binfmt_misc  bpf
  cgroup   cgroup2  configfs  cramfs  debugfs    devpts       devtmpfs
  [...]

---

command: 'command'
category: 'basic'
synopsis: |
  ["command"]
  
  ["command", <OPTIONS>]
short: 'Complete a command'
long: |
  This completer provides completion suggestions for executable commands available in the system's `$PATH`.
   
  `$PATH` can be modified using these options:
   
  `{"path": "<directory>:..."}`: Overrides the default `$PATH` entirely.
   
  `{"path_append": "<directory>:..."}`: Appends to the default `$PATH`.
   
  `{"path_prepend": "<directory>:..."}`: Prepends to the default `$PATH`.
notes:
  - '`path_append` and `path_prepend` can be used together, but both are mutually exclusive with `path`.'
also:
  command_arg: "For completing arguments of a command"
  commandline_string: 'For completing a command line as a string'
definition: |
  prog: "example"
  options:
    - option_strings: ["--command"]
      complete: ["command"]
    - option_strings: ["--command-sbin"]
      complete: ["command", {"path_append": "/sbin:/usr/sbin"}]
output: |
  ~ > example --command=bas<TAB>
  base32    base64    basename  basenc    bash      bashbug

---

command: 'command_arg'
category: 'basic'
short: 'Complete arguments of a command'
notes:
  - 'This completer can only be used in combination with a previously defined `command` completer.'
  - 'This completer requires `repeatable: true`.'
also:
  command: 'For completing a command'
  commandline_string: 'For completing a command line as a string'
definition: |
  prog: "example"
  positionals:
    - number: 1
      complete: ["command"]

    - number: 2
      complete: ["command_arg"]
      repeatable: true
output: |
  ~ > example sudo bas<TAB>
  base32    base64    basename  basenc    bash      bashbug

---

command: 'commandline_string'
category: 'basic'
short: 'Complete a command line as a string'
definition: |
  prog: "example"
  options:
    - option_strings: ["--commandline"]
      complete: ["commandline_string"]
output: |
  ~ > example --commandline='sudo ba<TAB>
  base32    base64    basename  basenc    bash      bashbug

---

command: 'user'
category: 'basic'
short: 'Complete a username'
also:
  uid: 'For completing a user id'
definition: |
  prog: "example"
  options:
    - option_strings: ["--user"]
      complete: ["user"]
output: |
  ~ > example --user=<TAB>
  avahi                   bin                     braph
  colord                  daemon                  dbus
  dhcpcd                  ftp                     git
  [...]

---

command: 'group'
category: 'basic'
short: 'Complete a group'
also:
  gid: 'For completing a group id'
definition: |
  prog: "example"
  options:
    - option_strings: ["--group"]
      complete: ["group"]
output: |
  ~ > example --group=<TAB>
  adm                     audio                   avahi
  bin                     braph                   colord
  daemon                  dbus                    dhcpcd
  disk                    floppy                  ftp
  games                   git                     groups
  [...]

---

command: 'uid'
category: 'basic'
short: 'Complete a user id'
also:
  user: 'For completing a user name'
definition: |
  prog: "example"
  options:
    - option_strings: ["--uid"]
      complete: ["uid"]
output: |
  ~ > example --uid=<TAB>
  0      -- root
  1000   -- braph
  102    -- polkitd
  133    -- rtkit
  14     -- ftp
  1      -- bin
  2      -- daemon
  33     -- http
  65534  -- nobody
  [...]

---

command: 'gid'
category: 'basic'
short: 'Complete a group id'
also:
  group: 'For completing a group name'
definition: |
  prog: "example"
  options:
    - option_strings: ["--gid"]
      complete: ["gid"]
output: |
  ~ > example --gid=<TAB>
  0      -- root
  1000   -- braph
  102    -- polkitd
  108    -- vboxusers
  11     -- ftp
  12     -- mail
  133    -- rtkit
  19     -- log
  [...]

---

command: 'service'
category: 'basic'
short: 'Complete a SystemD service'
definition: |
  prog: "example"
  options:
    - option_strings: ["--service"]
      complete: ["service"]
output: |
  ~ > example --service=<TAB>
  TODO
  [...]

---

command: 'variable'
category: 'basic'
short: 'Complete a shell variable name'
also:
  environment: 'For completing an environment variable'
definition: |
  prog: "example"
  options:
    - option_strings: ["--variable"]
      complete: ["variable"]
output: |
  ~ > example --variable=HO<TAB>
  HOME      HOSTNAME  HOSTTYPE

---

command: 'environment'
category: 'basic'
short: 'Complete a shell environment variable name'
definition: |
  prog: "example"
  options:
    - option_strings: ["--environment"]
      complete: ["environment"]
output: |
  ~ > example --environment=X<TAB>
  XDG_RUNTIME_DIR  XDG_SEAT  XDG_SESSION_CLASS  XDG_SESSION_ID
  XDG_SESSION_TYPE XDG_VTNR

---

command: 'history'
category: 'basic'
synopsis: |
  ["history", <REGEX>]
short: "Complete based on a shell's history"
long: |
  The argument is an extended regular expression passed to `grep -E`.
definition: |
  prog: "example"
  options:
    - option_strings: ["--history"]
      complete: ["history", '[a-zA-Z0-9]+@[a-zA-Z0-9]+']
output: |
  ~ > example --history=<TAB>
  foo@bar mymail@myprovider

---

command: 'date'
category: 'basic'
synopsis: |
  ["date", <FORMAT>]
short: 'Complete a date string'
long: |
  The argument is the date format as described in `strftime(3)`.
also:
  date_format: "For completing a date format string"
implemented: ['Zsh']
definition: |
  prog: "example"
  options:
    - option_strings: ["--date"]
      complete: ["date", '%Y-%m-%d']
output: |
  ~ > example --date=<TAB>
  
           November                        
  Mo  Tu  We  Th  Fr  Sa  Su     
       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                 

---

command: 'date_format'
category: 'basic'
short: 'Complete a date format string'
also:
  date: "For completing a date"
implemented: ['Fish', 'Zsh']
definition: |
  prog: "example"
  options:
    - option_strings: ["--date-format"]
      complete: ["date_format"]
output: |
  ~ > example --date-format '%<TAB>
  a     -- abbreviated day name
  A     -- full day name
  B     -- full month name
  c     -- preferred locale date and time
  C     -- 2-digit century
  d     -- day of month (01-31)
  D     -- American format month/day/year (%m/%d/%y)
  e     -- day of month ( 1-31)
  [...]

---

command: 'ip_address'
category: 'basic'
synopsis: |
  ["ip_address"]
  
  ["ip_address", "ipv4"]
  
  ["ip_address", "ipv6"]
short: 'Complete a bound ip address'
long: |
  By default, both IPv4 and IPv6 addresses are completed.
  
  To complete only IPv4 addresses, pass "ipv4" as argument.
  
  To complete only IPv6 addresses, pass "ipv6" as argument.
also:
  net_interface: "For completing a network interface"
definition: |
  prog: "example"
  options:
    - option_strings: ["--ip-address"]
      complete: ["ip_address"]
    - option_strings: ["--ip-address-v4"]
      complete: ["ip_address", "ipv4"]
    - option_strings: ["--ip-address-v6"]
      complete: ["ip_address", "ipv6"]
output: |
  ~ > example --ip-address=<TAB>
  ::1    10.0.0.71   127.0.0.1   fe80::f567:7a1a:3c98:808d
  
  ~ > example --ip-address-v4=<TAB>
  10.0.0.71   127.0.0.1
  
  ~ > example --ip-address-v6=<TAB>
  ::1   fe80::f567:7a1a:3c98:808d

---

command: 'net_interface'
category: 'bonus'
short: 'Complete a network interface'
also:
  ip_address: "For completing an ip address"
definition: |
  prog: "example"
  options:
    - option_strings: ["--net-interface"]
      complete: ["net_interface"]
output: |
  ~ > example --net-interface=<TAB>
  eno1  enp1s0  lo  wlo1  wlp2s0
  [...]

---

command: 'mountpoint'
category: 'bonus'
short: 'Complete a mountpoint'
definition: |
  prog: "example"
  options:
    - option_strings: ["--mountpoint"]
      complete: ["mountpoint"]
output: |
  ~ > example --mountpoint=<TAB>
  /  /boot  /home  /proc  /run  /sys  /tmp
  [...]

---

command: 'login_shell'
category: 'bonus'
short: 'Complete a login shell'
definition: |
  prog: "example"
  options:
    - option_strings: ["--login-shell"]
      complete: ["login_shell"]
output: |
  ~ > example --login-shell=<TAB>
  /bin/bash   /bin/sh         /usr/bin/fish       /usr/bin/sh
  [...]

---

command: 'charset'
category: 'bonus'
short: 'Complete a charset'
definition: |
  prog: "example"
  options:
    - option_strings: ["--charset"]
      complete: ["charset"]
output: |
  ~ > example --charset=A<TAB>
  ANSI_X3.110-1983  ANSI_X3.4-1968    ARMSCII-8         ASMO_449

---

command: 'locale'
category: 'bonus'
short: 'Complete a locale'
definition: |
  prog: "example"
  options:
    - option_strings: ["--locale"]
      complete: ["locale"]
output: |
  ~ > example --locale=<TAB>
  C  C.UTF-8  de_DE  de_DE@euro  de_DE.iso88591  de_DE.iso885915@euro
  de_DE.UTF-8  deutsch  en_US  en_US.iso88591  en_US.UTF-8  german  POSIX

---

command: 'timezone'
category: 'bonus'
short: 'Complete a timezone'
definition: |
  prog: "example"
  options:
    - option_strings: ["--timezone"]
      complete: ["timezone"]
output: |
  ~ > example --timezone=Europe/B<TAB>
  Belfast     Belgrade    Berlin      Bratislava
  Brussels    Bucharest   Budapest    Busingen

---

command: 'alsa_card'
category: 'bonus'
short: 'Complete an ALSA card'
also:
  alsa_device: "For completing an ALSA device"
definition: |
  prog: "example"
  options:
    - option_strings: ["--alsa-card"]
      complete: ["alsa_card"]
output: |
  ~ > example --alsa-card=<TAB>
  0  1

---

command: 'alsa_device'
category: 'bonus'
short: 'Complete an ALSA device'
also:
  alsa_card: "For completing an ALSA card"
definition: |
  prog: "example"
  options:
    - option_strings: ["--alsa-device"]
      complete: ["alsa_device"]
output: |
  ~ > example --alsa-device=<TAB>
  hw:0  hw:1