Debian Codegraph @

crazy_complete/manual.py

raw
1 # SPDX-License-Identifier: GPL-3.0-or-later
2 # Copyright (C) 2025-2026 Benjamin Abendroth <[email protected]>
3
4 '''Built-int Manual.'''
5
6 from .errors import CrazyError
7 from .str_utils import indent, join_with_wrap
8
9
10 # flake8: noqa: E501
11 # pylint: disable=line-too-long
12 # pylint: disable=too-many-lines
13
14
15 COMMANDS = [{'also': {'alsa_device': 'For completing ALSA devices'},
16 'category': 'bonus',
17 'command': 'alsa_card',
18 'definition': "prog: 'example'\n"
19 'options:\n'
20 " - option_strings: ['--alsa-card']\n"
21 " complete: ['alsa_card']\n",
22 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
23 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
24 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
25 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
26 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
27 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--alsa-card\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
28 '\x1b[37m '
29 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
30 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33malsa_card\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
31 'implemented': None,
32 'long': None,
33 'long_colored': None,
34 'notes': [],
35 'output': '~ > example --alsa-card=<TAB>\n0 1\n',
36 'short': 'Complete ALSA cards'},
37 {'also': {'alsa_card': 'For completing ALSA cards'},
38 'category': 'bonus',
39 'command': 'alsa_device',
40 'definition': "prog: 'example'\n"
41 'options:\n'
42 " - option_strings: ['--alsa-device']\n"
43 " complete: ['alsa_device']\n",
44 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
45 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
46 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
47 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
48 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
49 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--alsa-device\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
50 '\x1b[37m '
51 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
52 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33malsa_device\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
53 'implemented': None,
54 'long': None,
55 'long_colored': None,
56 'notes': [],
57 'output': '~ > example --alsa-device=<TAB>\nhw:0 hw:1\n',
58 'short': 'Complete ALSA devices'},
59 {'also': None,
60 'category': 'bonus',
61 'command': 'charset',
62 'definition': "prog: 'example'\n"
63 'options:\n'
64 " - option_strings: ['--charset']\n"
65 " complete: ['charset']\n",
66 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
67 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
68 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
69 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
70 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
71 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--charset\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
72 '\x1b[37m '
73 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
74 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcharset\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
75 'implemented': None,
76 'long': None,
77 'long_colored': None,
78 'notes': [],
79 'output': '~ > example --charset=A<TAB>\n'
80 'ANSI_X3.110-1983 ANSI_X3.4-1968 ARMSCII-8 ASMO_449\n',
81 'short': 'Complete character sets'},
82 {'also': None,
83 'category': 'basic',
84 'command': 'choices',
85 'definition': "prog: 'example'\n"
86 'options:\n'
87 " - option_strings: ['--choices-1']\n"
88 " complete: ['choices', ['Item 1', 'Item 2']]\n"
89 '\n'
90 " - option_strings: ['--choices-2']\n"
91 " complete: ['choices', {'Item 1': 'Description 1', 'Item "
92 "2': 'Description 2'}]\n"
93 '\n'
94 " - option_strings: ['--choices-keep-order']\n"
95 " complete: ['choices', ['zebra', 'cat', 'monkey']]\n"
96 ' nosort: true\n',
97 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
98 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
99 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
100 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
101 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
102 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--choices-1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
103 '\x1b[37m '
104 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
105 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
106 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mItem\x1b[39;49;00m\x1b[31m "
107 "\x1b[39;49;00m\x1b[33m1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
108 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mItem\x1b[39;49;00m\x1b[31m "
109 "\x1b[39;49;00m\x1b[33m2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n"
110 '\x1b[37m\x1b[39;49;00m\n'
111 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
112 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
113 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--choices-2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
114 '\x1b[37m '
115 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
116 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
117 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mItem\x1b[39;49;00m\x1b[31m "
118 "\x1b[39;49;00m\x1b[33m1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
119 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mDescription\x1b[39;49;00m\x1b[31m "
120 "\x1b[39;49;00m\x1b[33m1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
121 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mItem\x1b[39;49;00m\x1b[31m "
122 "\x1b[39;49;00m\x1b[33m2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
123 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mDescription\x1b[39;49;00m\x1b[31m "
124 "\x1b[39;49;00m\x1b[33m2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}]\x1b[37m\x1b[39;49;00m\n"
125 '\x1b[37m\x1b[39;49;00m\n'
126 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
127 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
128 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--choices-keep-order\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
129 '\x1b[37m '
130 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
131 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
132 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mzebra\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
133 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mcat\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
134 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mmonkey\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n"
135 '\x1b[37m '
136 '\x1b[39;49;00m\x1b[94mnosort\x1b[39;49;00m:\x1b[37m '
137 '\x1b[39;49;00mtrue\x1b[37m\x1b[39;49;00m\n',
138 'implemented': None,
139 'long': '`ITEMS`:\n'
140 ' A list or dictionary containing the values to offer for '
141 'completion.\n'
142 '\n'
143 ' If a list is supplied, all items are offered without '
144 'descriptions.\n'
145 '\n'
146 ' If a dictionary is supplied, the keys are used as completion '
147 'values and the\n'
148 ' values are used as descriptions.\n',
149 'long_colored': '\x1b[33m`ITEMS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
150 ' A list or dictionary containing the values to offer for '
151 'completion.\x1b[37m\x1b[39;49;00m\n'
152 '\x1b[37m\x1b[39;49;00m\n'
153 ' If a list is supplied, all items are offered without '
154 'descriptions.\x1b[37m\x1b[39;49;00m\n'
155 '\x1b[37m\x1b[39;49;00m\n'
156 ' If a dictionary is supplied, the keys are used as '
157 'completion values and the\x1b[37m\x1b[39;49;00m\n'
158 ' values are used as descriptions.\x1b[37m\x1b[39;49;00m\n',
159 'notes': ['If the completion suggestions should appear in their original '
160 'order, set `nosort` to `true`'],
161 'output': '~ > example --choices-2=<TAB>\n'
162 'Item 1 (Description 1) Item 2 (Description 2)\n'
163 '\n'
164 '~ > example --choices-keep-order=<TAB>\n'
165 'zebra cat monkey\n',
166 'short': 'Complete from a predefined set of values'},
167 {'also': None,
168 'category': 'meta',
169 'command': 'combine',
170 'definition': "prog: 'example'\n"
171 'options:\n'
172 " - option_strings: ['--combine']\n"
173 " complete: ['combine', [['user'], ['pid']]]\n",
174 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
175 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
176 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
177 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
178 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
179 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--combine\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
180 '\x1b[37m '
181 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
182 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcombine\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
183 "\x1b[39;49;00m[[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m],\x1b[37m "
184 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mpid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]]]\x1b[37m\x1b[39;49;00m\n",
185 'implemented': None,
186 'long': 'Combines multiple completers into a single completer.\n'
187 '\n'
188 '`COMPLETERS`:\n'
189 ' A list of completers to combine.\n',
190 'long_colored': 'Combines multiple completers into a single '
191 'completer.\x1b[37m\x1b[39;49;00m\n'
192 '\n'
193 '\x1b[33m`COMPLETERS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
194 ' A list of completers to combine.\x1b[37m\x1b[39;49;00m\n',
195 'notes': [],
196 'output': '~ > example --combine=avahi,daemon,<TAB>\n'
197 '1439404 3488332 3571716 3607235 '
198 '4134206\n'
199 'alpm avahi bin braph '
200 'daemon\n'
201 'root rtkit systemd-coredump systemd-journal-remote '
202 'systemd-network\n'
203 '[...]\n',
204 'short': 'Combine multiple completers'},
205 {'also': {'command_arg': 'For completing arguments of a command',
206 'commandline_string': 'For completing command lines as strings'},
207 'category': 'basic',
208 'command': 'command',
209 'definition': "prog: 'example'\n"
210 'options:\n'
211 " - option_strings: ['--command']\n"
212 " complete: ['command']\n"
213 '\n'
214 " - option_strings: ['--command-sbin']\n"
215 " complete: ['command', {'path_append': "
216 "'/sbin:/usr/sbin'}]\n",
217 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
218 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
219 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
220 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
221 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
222 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--command\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
223 '\x1b[37m '
224 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
225 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcommand\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
226 '\x1b[37m\x1b[39;49;00m\n'
227 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
228 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
229 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--command-sbin\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
230 '\x1b[37m '
231 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
232 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcommand\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
233 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mpath_append\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
234 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m/sbin:/usr/sbin\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}]\x1b[37m\x1b[39;49;00m\n",
235 'implemented': None,
236 'long': 'This completer provides completion suggestions for executable '
237 "commands available in the system's `$PATH`.\n"
238 ' \n'
239 '`OPTIONS`:\n'
240 ' A dictionary containing additional options for configuring the '
241 'completion.\n'
242 '\n'
243 ' - `path`:\n'
244 ' Override the default `$PATH` used for searching executables.\n'
245 '\n'
246 ' - `path_append`:\n'
247 ' Append directories to the default `$PATH`.\n'
248 '\n'
249 ' - `path_prepend`:\n'
250 ' Prepend directories to the default `$PATH`.\n',
251 'long_colored': 'This completer provides completion suggestions for '
252 "executable commands available in the system's "
253 '\x1b[33m`$PATH`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
254 ' \n'
255 '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
256 ' A dictionary containing additional options for '
257 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
258 '\x1b[37m\x1b[39;49;00m\n'
259 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
260 '\x1b[39;49;00m\x1b[33m`path`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
261 ' Override the default \x1b[33m`$PATH`\x1b[39;49;00m used '
262 'for searching executables.\x1b[37m\x1b[39;49;00m\n'
263 '\x1b[37m\x1b[39;49;00m\n'
264 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
265 '\x1b[39;49;00m\x1b[33m`path_append`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
266 ' Append directories to the default '
267 '\x1b[33m`$PATH`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
268 '\x1b[37m\x1b[39;49;00m\n'
269 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
270 '\x1b[39;49;00m\x1b[33m`path_prepend`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
271 ' Prepend directories to the default '
272 '\x1b[33m`$PATH`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
273 'notes': ['`path_append` and `path_prepend` can be used together, but both '
274 'are mutually exclusive with `path`.'],
275 'output': '~ > example --command=bas<TAB>\n'
276 'base32 base64 basename basenc bash bashbug\n',
277 'short': 'Complete command names'},
278 {'also': {'command': 'For completing command names',
279 'commandline_string': 'For completing command lines as strings'},
280 'category': 'basic',
281 'command': 'command_arg',
282 'definition': "prog: 'example'\n"
283 'positionals:\n'
284 ' - number: 1\n'
285 " complete: ['command']\n"
286 '\n'
287 ' - number: 2\n'
288 " complete: ['command_arg']\n"
289 ' repeatable: true\n',
290 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
291 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
292 '\x1b[94mpositionals\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
293 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
294 '\x1b[39;49;00m\x1b[94mnumber\x1b[39;49;00m:\x1b[37m '
295 '\x1b[39;49;00m1\x1b[37m\x1b[39;49;00m\n'
296 '\x1b[37m '
297 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
298 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcommand\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
299 '\x1b[37m\x1b[39;49;00m\n'
300 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
301 '\x1b[39;49;00m\x1b[94mnumber\x1b[39;49;00m:\x1b[37m '
302 '\x1b[39;49;00m2\x1b[37m\x1b[39;49;00m\n'
303 '\x1b[37m '
304 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
305 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcommand_arg\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
306 '\x1b[37m '
307 '\x1b[39;49;00m\x1b[94mrepeatable\x1b[39;49;00m:\x1b[37m '
308 '\x1b[39;49;00mtrue\x1b[37m\x1b[39;49;00m\n',
309 'implemented': None,
310 'long': None,
311 'long_colored': None,
312 'notes': ['This completer can only be used in combination with a previously '
313 'defined `command` completer.',
314 'This completer requires `repeatable: true`.'],
315 'output': '~ > example sudo bas<TAB>\n'
316 'base32 base64 basename basenc bash bashbug\n',
317 'short': 'Complete command arguments'},
318 {'also': {'command': 'For completing command names',
319 'command_arg': 'For completing command arguments'},
320 'category': 'basic',
321 'command': 'commandline_string',
322 'definition': "prog: 'example'\n"
323 'options:\n'
324 " - option_strings: ['--commandline']\n"
325 " complete: ['commandline_string']\n",
326 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
327 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
328 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
329 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
330 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
331 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--commandline\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
332 '\x1b[37m '
333 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
334 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcommandline_string\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
335 'implemented': None,
336 'long': None,
337 'long_colored': None,
338 'notes': [],
339 'output': "~ > example --commandline='sudo ba<TAB>\n"
340 'base32 base64 basename basenc bash bashbug\n',
341 'short': 'Complete command lines as strings'},
342 {'also': {'date_format': 'For completing date format strings'},
343 'category': 'basic',
344 'command': 'date',
345 'definition': "prog: 'example'\n"
346 'options:\n'
347 " - option_strings: ['--date']\n"
348 " complete: ['date', '%Y-%m-%d']\n",
349 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
350 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
351 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
352 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
353 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
354 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--date\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
355 '\x1b[37m '
356 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
357 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mdate\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
358 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m%Y-%m-%d\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
359 'implemented': ['Zsh'],
360 'long': '`FORMAT`:\n The date format as described in `strftime(3)`.\n',
361 'long_colored': '\x1b[33m`FORMAT`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
362 ' The date format as described in '
363 '\x1b[33m`strftime(3)`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
364 'notes': [],
365 'output': '~ > example --date=<TAB>\n'
366 '\n'
367 ' November\n'
368 'Mo Tu We Th Fr Sa Su\n'
369 ' 1 2 3 4 5 6\n'
370 ' 7 8 9 10 11 12 13\n'
371 '14 15 16 17 18 19 20\n'
372 '21 22 23 24 25 26 27\n'
373 '28 29 30\n',
374 'short': 'Complete date strings'},
375 {'also': {'date': 'For completing dates'},
376 'category': 'basic',
377 'command': 'date_format',
378 'definition': "prog: 'example'\n"
379 'options:\n'
380 " - option_strings: ['--date-format']\n"
381 " complete: ['date_format']\n",
382 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
383 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
384 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
385 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
386 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
387 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--date-format\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
388 '\x1b[37m '
389 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
390 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mdate_format\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
391 'implemented': ['Fish', 'Zsh'],
392 'long': None,
393 'long_colored': None,
394 'notes': [],
395 'output': "~ > example --date-format '%<TAB>\n"
396 'a -- abbreviated day name\n'
397 'A -- full day name\n'
398 'B -- full month name\n'
399 'c -- preferred locale date and time\n'
400 'C -- 2-digit century\n'
401 'd -- day of month (01-31)\n'
402 'D -- American format month/day/year (%m/%d/%y)\n'
403 'e -- day of month ( 1-31)\n'
404 '[...]\n',
405 'short': 'Complete date format strings'},
406 {'also': {'directory_list': 'For completing comma-separated lists of '
407 'directories'},
408 'category': 'basic',
409 'command': 'directory',
410 'definition': "prog: 'example'\n"
411 'options:\n'
412 " - option_strings: ['--directory']\n"
413 " complete: ['directory']\n"
414 '\n'
415 " - option_strings: ['--directory-tmp']\n"
416 " complete: ['directory', {'directory': '/tmp'}]\n",
417 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
418 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
419 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
420 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
421 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
422 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--directory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
423 '\x1b[37m '
424 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
425 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mdirectory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
426 '\x1b[37m\x1b[39;49;00m\n'
427 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
428 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
429 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--directory-tmp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
430 '\x1b[37m '
431 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
432 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mdirectory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
433 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mdirectory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
434 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m/tmp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}]\x1b[37m\x1b[39;49;00m\n",
435 'implemented': None,
436 'long': '`OPTIONS`:\n'
437 ' A dictionary containing additional options for configuring the '
438 'completion.\n'
439 '\n'
440 ' - `directory`: Restrict completion to directories inside the '
441 'specified directory.\n',
442 'long_colored': '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
443 ' A dictionary containing additional options for '
444 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
445 '\x1b[37m\x1b[39;49;00m\n'
446 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
447 '\x1b[39;49;00m\x1b[33m`directory`\x1b[39;49;00m: Restrict '
448 'completion to directories inside the specified '
449 'directory.\x1b[37m\x1b[39;49;00m\n',
450 'notes': [],
451 'output': '~ > example --directory=<TAB>\ndir1/ dir2/\n',
452 'short': 'Complete directory names'},
453 {'also': {'directory': 'For completing directory names',
454 'file_list': 'For completing comma-separated lists of files',
455 'list': 'For completion comma-separated lists using a completer'},
456 'category': 'basic',
457 'command': 'directory_list',
458 'definition': "prog: 'example'\n"
459 'options:\n'
460 " - option_strings: ['--directory-list']\n"
461 " complete: ['directory_list']\n",
462 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
463 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
464 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
465 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
466 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
467 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--directory-list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
468 '\x1b[37m '
469 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
470 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mdirectory_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
471 'implemented': None,
472 'long': "This is an alias for `['list', ['directory']]`.\n"
473 '\n'
474 '`OPTIONS`:\n'
475 ' A dictionary containing additional options for configuring the '
476 'completion.\n'
477 '\n'
478 ' - `directory`:\n'
479 ' Restrict completion to directories inside the specified '
480 'directory.\n'
481 '\n'
482 ' - `duplicates`:\n'
483 ' Allow duplicate values to be offered for completion. Defaults '
484 'to `false`.\n'
485 '\n'
486 ' - `separator`:\n'
487 ' The separator used between list elements. Defaults to `,`.\n',
488 'long_colored': "This is an alias for \x1b[33m`['list', "
489 "['directory']]`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n"
490 '\n'
491 '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
492 ' A dictionary containing additional options for '
493 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
494 '\x1b[37m\x1b[39;49;00m\n'
495 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
496 '\x1b[39;49;00m\x1b[33m`directory`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
497 ' Restrict completion to directories inside the specified '
498 'directory.\x1b[37m\x1b[39;49;00m\n'
499 '\x1b[37m\x1b[39;49;00m\n'
500 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
501 '\x1b[39;49;00m\x1b[33m`duplicates`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
502 ' Allow duplicate values to be offered for completion. '
503 'Defaults to '
504 '\x1b[33m`false`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
505 '\x1b[37m\x1b[39;49;00m\n'
506 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
507 '\x1b[39;49;00m\x1b[33m`separator`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
508 ' The separator used between list elements. Defaults to '
509 '\x1b[33m`,`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
510 'notes': [],
511 'output': '~ > example --directory-list=directory1,directory2,<TAB>\n'
512 'directory3 directory4\n',
513 'short': 'Complete comma-separated lists of directories'},
514 {'also': {'variable': 'For completing shell variable names'},
515 'category': 'basic',
516 'command': 'environment',
517 'definition': "prog: 'example'\n"
518 'options:\n'
519 " - option_strings: ['--environment']\n"
520 " complete: ['environment']\n",
521 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
522 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
523 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
524 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
525 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
526 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--environment\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
527 '\x1b[37m '
528 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
529 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33menvironment\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
530 'implemented': None,
531 'long': None,
532 'long_colored': None,
533 'notes': [],
534 'output': '~ > example --environment=X<TAB>\n'
535 'XDG_RUNTIME_DIR XDG_SEAT XDG_SESSION_CLASS XDG_SESSION_ID\n'
536 'XDG_SESSION_TYPE XDG_VTNR\n',
537 'short': 'Complete environment variable names'},
538 {'also': {'exec_fast': 'Faster implementation of exec',
539 'exec_internal': "Use the shell's internal completion mechanisms"},
540 'category': 'custom',
541 'command': 'exec',
542 'definition': "prog: 'example'\n"
543 'options:\n'
544 " - option_strings: ['--exec']\n"
545 ' complete: [\'exec\', "printf \'%s\\\\t%s\\\\n\' \'Item '
546 '1\' \'Description 1\' \'Item 2\' \'Description 2\'"]\n',
547 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
548 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
549 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
550 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
551 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
552 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--exec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
553 '\x1b[37m '
554 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
555 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mexec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
556 '\x1b[39;49;00m\x1b[33m"\x1b[39;49;00m\x1b[33mprintf\x1b[39;49;00m\x1b[31m '
557 "\x1b[39;49;00m\x1b[33m'%s\x1b[39;49;00m\x1b[33m\\\\\x1b[39;49;00m\x1b[33mt%s\x1b[39;49;00m\x1b[33m\\\\\x1b[39;49;00m\x1b[33mn'\x1b[39;49;00m\x1b[31m "
558 "\x1b[39;49;00m\x1b[33m'Item\x1b[39;49;00m\x1b[31m "
559 "\x1b[39;49;00m\x1b[33m1'\x1b[39;49;00m\x1b[31m "
560 "\x1b[39;49;00m\x1b[33m'Description\x1b[39;49;00m\x1b[31m "
561 "\x1b[39;49;00m\x1b[33m1'\x1b[39;49;00m\x1b[31m "
562 "\x1b[39;49;00m\x1b[33m'Item\x1b[39;49;00m\x1b[31m "
563 "\x1b[39;49;00m\x1b[33m2'\x1b[39;49;00m\x1b[31m "
564 "\x1b[39;49;00m\x1b[33m'Description\x1b[39;49;00m\x1b[31m "
565 '\x1b[39;49;00m\x1b[33m2\'\x1b[39;49;00m\x1b[33m"\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n',
566 'implemented': None,
567 'long': '`COMMAND`:\n'
568 ' The command or function to execute. Its output must be formatted '
569 'as tab-separated values:\n'
570 '\n'
571 '```\n'
572 '<ITEM_1>\\t<DESCRIPTION_1>\n'
573 '<ITEM_2>\\t<DESCRIPTION_2>\n'
574 '[...]\n'
575 '```\n'
576 '\n'
577 'Each line represents one completion candidate. The item and its '
578 'description are separated by a tab character.\n',
579 'long_colored': '\x1b[33m`COMMAND`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
580 ' The command or function to execute. Its output must be '
581 'formatted as tab-separated values:\x1b[37m\x1b[39;49;00m\n'
582 '\x1b[33m\x1b[39;49;00m\n'
583 '\x1b[33m```\x1b[39;49;00m\n'
584 '\x1b[33m<ITEM_1>\\t<DESCRIPTION_1>\x1b[39;49;00m\n'
585 '\x1b[33m<ITEM_2>\\t<DESCRIPTION_2>\x1b[39;49;00m\n'
586 '\x1b[33m[...]\x1b[39;49;00m\n'
587 '\x1b[33m```\x1b[39;49;00m\n'
588 '\x1b[37m\x1b[39;49;00m\n'
589 'Each line represents one completion candidate. The item and '
590 'its description are separated by a tab '
591 'character.\x1b[37m\x1b[39;49;00m\n',
592 'notes': ['Functions can be put inside a file and included with '
593 '`--include-file`'],
594 'output': '~ > example --exec=<TAB>\n'
595 'Item 1 (Description 1) Item 2 (Description 2)\n',
596 'short': 'Complete values from the output of a command or function'},
597 {'also': None,
598 'category': 'custom',
599 'command': 'exec_fast',
600 'definition': "prog: 'example'\n"
601 'options:\n'
602 " - option_strings: ['--exec-fast']\n"
603 ' complete: [\'exec_fast\', "printf \'%s\\\\t%s\\\\n\' 1 '
604 'one 2 two"]\n',
605 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
606 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
607 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
608 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
609 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
610 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--exec-fast\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
611 '\x1b[37m '
612 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
613 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mexec_fast\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
614 '\x1b[39;49;00m\x1b[33m"\x1b[39;49;00m\x1b[33mprintf\x1b[39;49;00m\x1b[31m '
615 "\x1b[39;49;00m\x1b[33m'%s\x1b[39;49;00m\x1b[33m\\\\\x1b[39;49;00m\x1b[33mt%s\x1b[39;49;00m\x1b[33m\\\\\x1b[39;49;00m\x1b[33mn'\x1b[39;49;00m\x1b[31m "
616 '\x1b[39;49;00m\x1b[33m1\x1b[39;49;00m\x1b[31m '
617 '\x1b[39;49;00m\x1b[33mone\x1b[39;49;00m\x1b[31m '
618 '\x1b[39;49;00m\x1b[33m2\x1b[39;49;00m\x1b[31m '
619 '\x1b[39;49;00m\x1b[33mtwo\x1b[39;49;00m\x1b[33m"\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n',
620 'implemented': None,
621 'long': 'Faster version of `exec` for handling large amounts of data.\n'
622 '\n'
623 'Unlike `exec`, this implementation does not safely handle arbitrary '
624 'output.\n'
625 'Completion items must not contain whitespace or special shell '
626 'characters.\n',
627 'long_colored': 'Faster version of \x1b[33m`exec`\x1b[39;49;00m for handling '
628 'large amounts of data.\x1b[37m\x1b[39;49;00m\n'
629 '\x1b[37m\x1b[39;49;00m\n'
630 'Unlike \x1b[33m`exec`\x1b[39;49;00m, this implementation '
631 'does not safely handle arbitrary '
632 'output.\x1b[37m\x1b[39;49;00m\n'
633 'Completion items must not contain whitespace or special '
634 'shell characters.\x1b[37m\x1b[39;49;00m\n',
635 'notes': ['Functions can be put inside a file and included with '
636 '`--include-file`'],
637 'output': '~ > example --exec-fast=<TAB>\n1 -- one\n2 -- one\n',
638 'short': 'Complete values from the output of a command or function (fast and '
639 'unsafe)'},
640 {'also': None,
641 'category': 'custom',
642 'command': 'exec_internal',
643 'definition': "prog: 'example'\n"
644 'options:\n'
645 " - option_strings: ['--exec-internal']\n"
646 " complete: ['exec_internal', 'my_completion_func']\n",
647 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
648 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
649 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
650 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
651 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
652 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--exec-internal\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
653 '\x1b[37m '
654 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
655 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mexec_internal\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
656 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mmy_completion_func\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
657 'implemented': None,
658 'long': 'Execute a function that internally modifies the completion state.\n'
659 '\n'
660 'This is useful if a more advanced completion is needed.\n'
661 '\n'
662 'For **Bash**, it might look like:\n'
663 '\n'
664 '```sh\n'
665 'my_completion_func() {\n'
666 " COMPREPLY=( $(compgen -W 'read write append' -- '$cur') )\n"
667 '}\n'
668 '```\n'
669 '\n'
670 'For **Zsh**, it might look like:\n'
671 '\n'
672 '```sh\n'
673 'my_completion_func() {\n'
674 ' local items=(\n'
675 " read:'Read data from a file'\n"
676 " write:'Write data from a file'\n"
677 " append:'Append data to a file'\n"
678 ' )\n'
679 '\n'
680 " _describe 'my items' items\n"
681 '}\n'
682 '```\n'
683 '\n'
684 'For **Fish**, it might look like:\n'
685 '\n'
686 '```sh\n'
687 'function my_completion_func\n'
688 " printf '%s\\t%s\\n' \\\n"
689 " read 'Read data from a file' \\\n"
690 " write 'Write data from a file' \\\n"
691 " append 'Append data to a file'\n"
692 'end\n'
693 '```\n',
694 'long_colored': 'Execute a function that internally modifies the completion '
695 'state.\x1b[37m\x1b[39;49;00m\n'
696 '\x1b[37m\x1b[39;49;00m\n'
697 'This is useful if a more advanced completion is '
698 'needed.\x1b[37m\x1b[39;49;00m\n'
699 '\x1b[37m\x1b[39;49;00m\n'
700 'For **Bash**, it might look like:\x1b[37m\x1b[39;49;00m\n'
701 '\x1b[33m\x1b[39;49;00m\n'
702 '\x1b[33m```\x1b[39;49;00m\x1b[33msh\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
703 'my_completion_func()\x1b[37m '
704 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
705 '\x1b[37m '
706 '\x1b[39;49;00m\x1b[31mCOMPREPLY\x1b[39;49;00m=(\x1b[37m '
707 '\x1b[39;49;00m\x1b[34m$(\x1b[39;49;00m\x1b[36mcompgen\x1b[39;49;00m\x1b[37m '
708 "\x1b[39;49;00m-W\x1b[37m \x1b[39;49;00m\x1b[33m'read write "
709 "append'\x1b[39;49;00m\x1b[37m \x1b[39;49;00m--\x1b[37m "
710 "\x1b[39;49;00m\x1b[33m'$cur'\x1b[39;49;00m\x1b[34m)\x1b[39;49;00m\x1b[37m "
711 '\x1b[39;49;00m)\x1b[37m\x1b[39;49;00m\n'
712 '}\x1b[37m\x1b[39;49;00m\n'
713 '\x1b[33m```\x1b[39;49;00m\n'
714 '\x1b[37m\x1b[39;49;00m\n'
715 'For **Zsh**, it might look like:\x1b[37m\x1b[39;49;00m\n'
716 '\x1b[33m\x1b[39;49;00m\n'
717 '\x1b[33m```\x1b[39;49;00m\x1b[33msh\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
718 'my_completion_func()\x1b[37m '
719 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
720 '\x1b[37m '
721 '\x1b[39;49;00m\x1b[36mlocal\x1b[39;49;00m\x1b[37m '
722 '\x1b[39;49;00m\x1b[31mitems\x1b[39;49;00m=(\x1b[37m\x1b[39;49;00m\n'
723 "\x1b[37m \x1b[39;49;00mread:\x1b[33m'Read data from "
724 "a file'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
725 "\x1b[37m \x1b[39;49;00mwrite:\x1b[33m'Write data "
726 "from a file'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
727 "\x1b[37m \x1b[39;49;00mappend:\x1b[33m'Append data "
728 "to a file'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
729 '\x1b[37m \x1b[39;49;00m)\x1b[37m\x1b[39;49;00m\n'
730 '\x1b[37m\x1b[39;49;00m\n'
731 '\x1b[37m \x1b[39;49;00m_describe\x1b[37m '
732 "\x1b[39;49;00m\x1b[33m'my items'\x1b[39;49;00m\x1b[37m "
733 '\x1b[39;49;00mitems\x1b[37m\x1b[39;49;00m\n'
734 '}\x1b[37m\x1b[39;49;00m\n'
735 '\x1b[33m```\x1b[39;49;00m\n'
736 '\x1b[37m\x1b[39;49;00m\n'
737 'For **Fish**, it might look like:\x1b[37m\x1b[39;49;00m\n'
738 '\x1b[33m\x1b[39;49;00m\n'
739 '\x1b[33m```\x1b[39;49;00m\x1b[33msh\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
740 '\x1b[34mfunction\x1b[39;49;00m\x1b[37m '
741 '\x1b[39;49;00mmy_completion_func\x1b[37m\x1b[39;49;00m\n'
742 '\x1b[37m '
743 '\x1b[39;49;00m\x1b[36mprintf\x1b[39;49;00m\x1b[37m '
744 "\x1b[39;49;00m\x1b[33m'%s\\t%s\\n'\x1b[39;49;00m\x1b[37m "
745 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
746 '\x1b[37m '
747 '\x1b[39;49;00m\x1b[36mread\x1b[39;49;00m\x1b[37m '
748 "\x1b[39;49;00m\x1b[33m'Read data from a "
749 "file'\x1b[39;49;00m\x1b[37m "
750 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
751 '\x1b[37m \x1b[39;49;00mwrite\x1b[37m '
752 "\x1b[39;49;00m\x1b[33m'Write data from a "
753 "file'\x1b[39;49;00m\x1b[37m "
754 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
755 '\x1b[37m \x1b[39;49;00mappend\x1b[37m '
756 "\x1b[39;49;00m\x1b[33m'Append data to a "
757 "file'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
758 'end\x1b[37m\x1b[39;49;00m\n'
759 '\x1b[33m```\x1b[39;49;00m\n',
760 'notes': ['Functions can be put inside a file and included with '
761 '`--include-file`'],
762 'output': '~ > example --exec-internal=<TAB>\n'
763 'append -- Append data to a file\n'
764 'read -- Read data from a file\n'
765 'write -- Write data from a file\n',
766 'short': "Use the shell's internal completion mechanisms"},
767 {'also': {'file_list': 'For completing comma-separated lists of files',
768 'mime_file': 'For completing files by MIME type'},
769 'category': 'basic',
770 'command': 'file',
771 'definition': "prog: 'example'\n"
772 'options:\n'
773 " - option_strings: ['--file']\n"
774 " complete: ['file']\n"
775 '\n'
776 " - option_strings: ['--file-tmp']\n"
777 " complete: ['file', {'directory': '/tmp'}]\n"
778 '\n'
779 " - option_strings: ['--file-ext']\n"
780 " complete: ['file', {'extensions': ['c', 'cpp']}]\n"
781 '\n'
782 " - option_strings: ['--file-ignore']\n"
783 " complete: ['file', {'ignore_globs': ['*.[tT][xX][tT]', "
784 "'*.c++']}]\n",
785 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
786 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
787 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
788 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
789 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
790 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--file\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
791 '\x1b[37m '
792 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
793 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
794 '\x1b[37m\x1b[39;49;00m\n'
795 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
796 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
797 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--file-tmp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
798 '\x1b[37m '
799 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
800 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
801 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mdirectory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
802 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m/tmp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}]\x1b[37m\x1b[39;49;00m\n"
803 '\x1b[37m\x1b[39;49;00m\n'
804 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
805 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
806 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--file-ext\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
807 '\x1b[37m '
808 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
809 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
810 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mextensions\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
811 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mc\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
812 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mcpp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]}]\x1b[37m\x1b[39;49;00m\n"
813 '\x1b[37m\x1b[39;49;00m\n'
814 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
815 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
816 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--file-ignore\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
817 '\x1b[37m '
818 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
819 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
820 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mignore_globs\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
821 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m*.[tT][xX][tT]\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
822 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m*.c++\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]}]\x1b[37m\x1b[39;49;00m\n",
823 'implemented': None,
824 'long': '`OPTIONS`:\n'
825 ' A dictionary containing additional options for configuring the '
826 'completion.\n'
827 '\n'
828 ' - `directory`: Restrict completion to files inside the specified '
829 'directory.\n'
830 '\n'
831 ' - `extensions`: A list of file extensions to offer for '
832 'completion.\n'
833 '\n'
834 ' - `fuzzy`:\n'
835 ' Enable fuzzy extension matching.\n'
836 ' By default, files must end with one of the specified '
837 'extensions.\n'
838 ' With fuzzy matching enabled, files with additional suffixes are '
839 'also matched, for example `foo.txt.1`.\n'
840 ' \n'
841 ' - `ignore_globs`:\n'
842 ' A list of Bash globs for files that should not be offered for '
843 'completion.\n'
844 '\n'
845 '**NOTE:** Restricting completion to specific file extensions only '
846 'makes sense\n'
847 'if the program being completed actually expects files of those '
848 'types. On\n'
849 'Unix-like systems, file extensions generally have no inherent '
850 'meaning and are\n'
851 'only conventions.\n',
852 'long_colored': '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
853 ' A dictionary containing additional options for '
854 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
855 '\x1b[37m\x1b[39;49;00m\n'
856 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
857 '\x1b[39;49;00m\x1b[33m`directory`\x1b[39;49;00m: Restrict '
858 'completion to files inside the specified '
859 'directory.\x1b[37m\x1b[39;49;00m\n'
860 '\x1b[37m\x1b[39;49;00m\n'
861 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
862 '\x1b[39;49;00m\x1b[33m`extensions`\x1b[39;49;00m: A list of '
863 'file extensions to offer for '
864 'completion.\x1b[37m\x1b[39;49;00m\n'
865 '\x1b[37m\x1b[39;49;00m\n'
866 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
867 '\x1b[39;49;00m\x1b[33m`fuzzy`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
868 ' Enable fuzzy extension matching.\x1b[37m\x1b[39;49;00m\n'
869 ' By default, files must end with one of the specified '
870 'extensions.\x1b[37m\x1b[39;49;00m\n'
871 ' With fuzzy matching enabled, files with additional '
872 'suffixes are also matched, for example '
873 '\x1b[33m`foo.txt.1`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
874 '\x1b[37m \x1b[39;49;00m\n'
875 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
876 '\x1b[39;49;00m\x1b[33m`ignore_globs`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
877 ' A list of Bash globs for files that should not be '
878 'offered for completion.\x1b[37m\x1b[39;49;00m\n'
879 '\n'
880 '**NOTE:** Restricting completion to specific file '
881 'extensions only makes sense\x1b[37m\x1b[39;49;00m\n'
882 'if the program being completed actually expects files of '
883 'those types. On\x1b[37m\x1b[39;49;00m\n'
884 'Unix-like systems, file extensions generally have no '
885 'inherent meaning and are\x1b[37m\x1b[39;49;00m\n'
886 'only conventions.\x1b[37m\x1b[39;49;00m\n',
887 'notes': [],
888 'output': '~ > example --file=<TAB>\n'
889 'dir1/ dir2/ file1 file2\n'
890 '\n'
891 '~ > example --file-ext=<TAB>\n'
892 'dir1/ dir2/ file.c file.cpp\n',
893 'short': 'Complete file names'},
894 {'also': {'directory_list': 'For completing comma-separated lists of '
895 'directories',
896 'file': 'For completing file names',
897 'list': 'For completing comma-separted lists using a completer'},
898 'category': 'basic',
899 'command': 'file_list',
900 'definition': "prog: 'example'\n"
901 'options:\n'
902 " - option_strings: ['--file-list']\n"
903 " complete: ['file_list']\n",
904 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
905 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
906 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
907 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
908 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
909 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--file-list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
910 '\x1b[37m '
911 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
912 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
913 'implemented': None,
914 'long': "This is an alias for `['list', ['file']]`.\n"
915 '\n'
916 '`OPTIONS`:\n'
917 ' A dictionary containing additional options for configuring the '
918 'completion.\n'
919 '\n'
920 ' - `directory`:\n'
921 ' Restrict completion to files inside the specified directory.\n'
922 '\n'
923 ' - `extensions`:\n'
924 ' A list of file extensions to offer for completion.\n'
925 '\n'
926 ' - `fuzzy`:\n'
927 ' Enable fuzzy extension matching. By default, files must end '
928 'with one of\n'
929 ' the specified extensions. With fuzzy matching enabled, files '
930 'with\n'
931 ' additional suffixes are also matched, for example `foo.txt.1`.\n'
932 '\n'
933 ' - `ignore_globs`:\n'
934 ' A list of Bash globs for files that should not be offered for '
935 'completion.\n'
936 '\n'
937 ' - `duplicates`:\n'
938 ' Allow duplicate values to be offered for completion. Defaults '
939 'to `false`.\n'
940 '\n'
941 ' - `separator`:\n'
942 ' The separator used between list elements. Defaults to `,`.\n',
943 'long_colored': "This is an alias for \x1b[33m`['list', "
944 "['file']]`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n"
945 '\n'
946 '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
947 ' A dictionary containing additional options for '
948 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
949 '\x1b[37m\x1b[39;49;00m\n'
950 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
951 '\x1b[39;49;00m\x1b[33m`directory`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
952 ' Restrict completion to files inside the specified '
953 'directory.\x1b[37m\x1b[39;49;00m\n'
954 '\x1b[37m\x1b[39;49;00m\n'
955 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
956 '\x1b[39;49;00m\x1b[33m`extensions`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
957 ' A list of file extensions to offer for '
958 'completion.\x1b[37m\x1b[39;49;00m\n'
959 '\x1b[37m\x1b[39;49;00m\n'
960 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
961 '\x1b[39;49;00m\x1b[33m`fuzzy`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
962 ' Enable fuzzy extension matching. By default, files must '
963 'end with one of\x1b[37m\x1b[39;49;00m\n'
964 ' the specified extensions. With fuzzy matching enabled, '
965 'files with\x1b[37m\x1b[39;49;00m\n'
966 ' additional suffixes are also matched, for example '
967 '\x1b[33m`foo.txt.1`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
968 '\x1b[37m\x1b[39;49;00m\n'
969 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
970 '\x1b[39;49;00m\x1b[33m`ignore_globs`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
971 ' A list of Bash globs for files that should not be '
972 'offered for completion.\x1b[37m\x1b[39;49;00m\n'
973 '\x1b[37m\x1b[39;49;00m\n'
974 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
975 '\x1b[39;49;00m\x1b[33m`duplicates`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
976 ' Allow duplicate values to be offered for completion. '
977 'Defaults to '
978 '\x1b[33m`false`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
979 '\x1b[37m\x1b[39;49;00m\n'
980 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
981 '\x1b[39;49;00m\x1b[33m`separator`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
982 ' The separator used between list elements. Defaults to '
983 '\x1b[33m`,`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
984 'notes': [],
985 'output': '~ > example --file-list=file1,file2,<TAB>\nfile3 file4\n',
986 'short': 'Complete comma-separated lists of files'},
987 {'also': None,
988 'category': 'basic',
989 'command': 'filesystem_type',
990 'definition': "prog: 'example'\n"
991 'options:\n'
992 " - option_strings: ['--filesystem-type']\n"
993 " complete: ['filesystem_type']\n",
994 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
995 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
996 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
997 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
998 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
999 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--filesystem-type\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1000 '\x1b[37m '
1001 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1002 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfilesystem_type\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1003 'implemented': None,
1004 'long': None,
1005 'long_colored': None,
1006 'notes': [],
1007 'output': '~ > example --filesystem-type=<TAB>\n'
1008 'adfs autofs bdev bfs binder binfmt_misc bpf\n'
1009 'cgroup cgroup2 configfs cramfs debugfs devpts '
1010 'devtmpfs\n'
1011 '[...]\n',
1012 'short': 'Complete filesystem types'},
1013 {'also': {'integer': 'For completing integer values'},
1014 'category': 'basic',
1015 'command': 'float',
1016 'definition': "prog: 'example'\n"
1017 'options:\n'
1018 " - option_strings: ['--time']\n"
1019 " complete: ['float', {'suffixes': {'s': 'seconds', 'm': "
1020 "'minutes', 'h': 'hours'}}]\n",
1021 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1022 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1023 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1024 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1025 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1026 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--time\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1027 '\x1b[37m '
1028 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1029 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfloat\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1030 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33msuffixes\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1031 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33ms\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1032 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mseconds\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1033 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mm\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1034 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mminutes\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1035 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mh\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1036 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mhours\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}}]\x1b[37m\x1b[39;49;00m\n",
1037 'implemented': None,
1038 'long': '`OPTIONS`:\n'
1039 ' A dictionary containing additional options for configuring the '
1040 'completion.\n'
1041 '\n'
1042 ' - `min`: The minimum allowed value.\n'
1043 '\n'
1044 ' - `max`: The maximum allowed value.\n'
1045 '\n'
1046 ' - `suffixes`: A dictionary of suffixes and their descriptions. '
1047 'The suffix is appended to the completed value.\n'
1048 '\n'
1049 ' - `help`: The help text shown during completion. If not '
1050 'specified, the `help` attribute of the option is used.\n',
1051 'long_colored': '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1052 ' A dictionary containing additional options for '
1053 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
1054 '\x1b[37m\x1b[39;49;00m\n'
1055 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1056 '\x1b[39;49;00m\x1b[33m`min`\x1b[39;49;00m: The minimum '
1057 'allowed value.\x1b[37m\x1b[39;49;00m\n'
1058 '\x1b[37m\x1b[39;49;00m\n'
1059 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1060 '\x1b[39;49;00m\x1b[33m`max`\x1b[39;49;00m: The maximum '
1061 'allowed value.\x1b[37m\x1b[39;49;00m\n'
1062 '\x1b[37m\x1b[39;49;00m\n'
1063 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1064 '\x1b[39;49;00m\x1b[33m`suffixes`\x1b[39;49;00m: A '
1065 'dictionary of suffixes and their descriptions. The suffix '
1066 'is appended to the completed value.\x1b[37m\x1b[39;49;00m\n'
1067 '\x1b[37m\x1b[39;49;00m\n'
1068 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1069 '\x1b[39;49;00m\x1b[33m`help`\x1b[39;49;00m: The help text '
1070 'shown during completion. If not specified, the '
1071 '\x1b[33m`help`\x1b[39;49;00m attribute of the option is '
1072 'used.\x1b[37m\x1b[39;49;00m\n',
1073 'notes': [],
1074 'output': '~ > example --time=3.0<TAB>\n'
1075 's -- seconds m -- minutes h -- hours\n',
1076 'short': 'Complete floating-point values'},
1077 {'also': {'group': 'For completing group names'},
1078 'category': 'basic',
1079 'command': 'gid',
1080 'definition': "prog: 'example'\n"
1081 'options:\n'
1082 " - option_strings: ['--gid']\n"
1083 " complete: ['gid']\n",
1084 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1085 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1086 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1087 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1088 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1089 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--gid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1090 '\x1b[37m '
1091 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1092 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mgid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1093 'implemented': None,
1094 'long': None,
1095 'long_colored': None,
1096 'notes': [],
1097 'output': '~ > example --gid=<TAB>\n'
1098 '0 -- root\n'
1099 '1000 -- braph\n'
1100 '102 -- polkitd\n'
1101 '108 -- vboxusers\n'
1102 '11 -- ftp\n'
1103 '12 -- mail\n'
1104 '133 -- rtkit\n'
1105 '19 -- log\n'
1106 '[...]\n',
1107 'short': 'Complete group IDs'},
1108 {'also': {'gid': 'For completing group IDs'},
1109 'category': 'basic',
1110 'command': 'group',
1111 'definition': "prog: 'example'\n"
1112 'options:\n'
1113 " - option_strings: ['--group']\n"
1114 " complete: ['group']\n",
1115 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1116 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1117 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1118 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1119 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1120 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--group\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1121 '\x1b[37m '
1122 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1123 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mgroup\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1124 'implemented': None,
1125 'long': None,
1126 'long_colored': None,
1127 'notes': [],
1128 'output': '~ > example --group=<TAB>\n'
1129 'adm audio avahi\n'
1130 'bin braph colord\n'
1131 'daemon dbus dhcpcd\n'
1132 'disk floppy ftp\n'
1133 'games git groups\n'
1134 '[...]\n',
1135 'short': 'Complete group names'},
1136 {'also': None,
1137 'category': 'basic',
1138 'command': 'history',
1139 'definition': "prog: 'example'\n"
1140 'options:\n'
1141 " - option_strings: ['--history']\n"
1142 " complete: ['history', '[a-zA-Z0-9]+@[a-zA-Z0-9]+']\n",
1143 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1144 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1145 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1146 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1147 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1148 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--history\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1149 '\x1b[37m '
1150 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1151 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mhistory\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1152 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m[a-zA-Z0-9]+@[a-zA-Z0-9]+\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1153 'implemented': None,
1154 'long': '`REGEX`:\n'
1155 ' An extended regular expression used to filter history entries.\n'
1156 ' The regular expression is passed to `grep -E`.\n',
1157 'long_colored': '\x1b[33m`REGEX`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1158 ' An extended regular expression used to filter history '
1159 'entries.\x1b[37m\x1b[39;49;00m\n'
1160 ' The regular expression is passed to \x1b[33m`grep '
1161 '-E`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
1162 'notes': [],
1163 'output': '~ > example --history=<TAB>\nfoo@bar mymail@myprovider\n',
1164 'short': "Complete based on a shell's history"},
1165 {'also': {'ip_address': 'For completing local IP addresses'},
1166 'category': 'basic',
1167 'command': 'hostname',
1168 'definition': "prog: 'example'\n"
1169 'options:\n'
1170 " - option_strings: ['--hostname']\n"
1171 " complete: ['hostname']\n",
1172 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1173 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1174 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1175 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1176 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1177 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--hostname\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1178 '\x1b[37m '
1179 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1180 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mhostname\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1181 'implemented': None,
1182 'long': None,
1183 'long_colored': None,
1184 'notes': [],
1185 'output': '~ > example --hostname=<TAB>\nlocalhost\n',
1186 'short': 'Complete hostnames'},
1187 {'also': {'float': 'For completing floating-point values',
1188 'range': 'For completing sequences of integers'},
1189 'category': 'basic',
1190 'command': 'integer',
1191 'definition': "prog: 'example'\n"
1192 'options:\n'
1193 " - option_strings: ['--time']\n"
1194 " complete: ['integer', {'suffixes': {'s': 'seconds', 'm': "
1195 "'minutes', 'h': 'hours'}}]\n",
1196 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1197 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1198 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1199 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1200 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1201 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--time\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1202 '\x1b[37m '
1203 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1204 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33minteger\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1205 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33msuffixes\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1206 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33ms\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1207 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mseconds\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1208 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mm\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1209 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mminutes\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1210 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mh\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1211 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mhours\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}}]\x1b[37m\x1b[39;49;00m\n",
1212 'implemented': None,
1213 'long': '`OPTIONS`:\n'
1214 ' A dictionary containing additional options for configuring the '
1215 'completion.\n'
1216 '\n'
1217 ' - `min`: The minimum allowed value.\n'
1218 '\n'
1219 ' - `max`: The maximum allowed value.\n'
1220 '\n'
1221 ' - `suffixes`: A dictionary of suffixes and their descriptions. '
1222 'The suffix is appended to the completed value.\n'
1223 '\n'
1224 ' - `help`: The help text shown during completion. If not '
1225 'specified, the `help` attribute of the option is used.\n',
1226 'long_colored': '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1227 ' A dictionary containing additional options for '
1228 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
1229 '\x1b[37m\x1b[39;49;00m\n'
1230 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1231 '\x1b[39;49;00m\x1b[33m`min`\x1b[39;49;00m: The minimum '
1232 'allowed value.\x1b[37m\x1b[39;49;00m\n'
1233 '\x1b[37m\x1b[39;49;00m\n'
1234 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1235 '\x1b[39;49;00m\x1b[33m`max`\x1b[39;49;00m: The maximum '
1236 'allowed value.\x1b[37m\x1b[39;49;00m\n'
1237 '\x1b[37m\x1b[39;49;00m\n'
1238 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1239 '\x1b[39;49;00m\x1b[33m`suffixes`\x1b[39;49;00m: A '
1240 'dictionary of suffixes and their descriptions. The suffix '
1241 'is appended to the completed value.\x1b[37m\x1b[39;49;00m\n'
1242 '\x1b[37m\x1b[39;49;00m\n'
1243 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1244 '\x1b[39;49;00m\x1b[33m`help`\x1b[39;49;00m: The help text '
1245 'shown during completion. If not specified, the '
1246 '\x1b[33m`help`\x1b[39;49;00m attribute of the option is '
1247 'used.\x1b[37m\x1b[39;49;00m\n',
1248 'notes': [],
1249 'output': '~ > example --integer=3<TAB>\n'
1250 's -- seconds m -- minutes h -- hours\n',
1251 'short': 'Complete integer values'},
1252 {'also': {'hostname': 'For completing hostnames',
1253 'net_interface': 'For completing network interfaces'},
1254 'category': 'basic',
1255 'command': 'ip_address',
1256 'definition': "prog: 'example'\n"
1257 'options:\n'
1258 " - option_strings: ['--ip-address']\n"
1259 " complete: ['ip_address']\n"
1260 '\n'
1261 " - option_strings: ['--ip-address-v4']\n"
1262 " complete: ['ip_address', 'ipv4']\n"
1263 '\n'
1264 " - option_strings: ['--ip-address-v6']\n"
1265 " complete: ['ip_address', 'ipv6']\n",
1266 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1267 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1268 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1269 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1270 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1271 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--ip-address\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1272 '\x1b[37m '
1273 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1274 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mip_address\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1275 '\x1b[37m\x1b[39;49;00m\n'
1276 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1277 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1278 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--ip-address-v4\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1279 '\x1b[37m '
1280 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1281 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mip_address\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1282 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mipv4\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1283 '\x1b[37m\x1b[39;49;00m\n'
1284 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1285 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1286 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--ip-address-v6\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1287 '\x1b[37m '
1288 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1289 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mip_address\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1290 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mipv6\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1291 'implemented': None,
1292 'long': '`TYPE`:\n'
1293 ' The type of ip addresses to complete:\n'
1294 '\n'
1295 ' - `ipv4`: IPv4 addresses\n'
1296 ' - `ipv6`: IPv6 addresses\n'
1297 ' - `all`: Both IPv4 and IPv6 addresses\n'
1298 '\n'
1299 ' Append `+` to include the unspecified address of the selected '
1300 'family:\n'
1301 '\n'
1302 ' - `ipv4+`: Includes `0.0.0.0`\n'
1303 ' - `ipv6+`: Includes `::`\n'
1304 ' - `all+`: Includes both 0.0.0.0 and `::`\n',
1305 'long_colored': '\x1b[33m`TYPE`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1306 ' The type of ip addresses to '
1307 'complete:\x1b[37m\x1b[39;49;00m\n'
1308 '\x1b[37m\x1b[39;49;00m\n'
1309 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1310 '\x1b[39;49;00m\x1b[33m`ipv4`\x1b[39;49;00m: IPv4 '
1311 'addresses\x1b[37m\x1b[39;49;00m\n'
1312 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1313 '\x1b[39;49;00m\x1b[33m`ipv6`\x1b[39;49;00m: IPv6 '
1314 'addresses\x1b[37m\x1b[39;49;00m\n'
1315 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1316 '\x1b[39;49;00m\x1b[33m`all`\x1b[39;49;00m: Both IPv4 and '
1317 'IPv6 addresses\x1b[37m\x1b[39;49;00m\n'
1318 '\x1b[37m\x1b[39;49;00m\n'
1319 ' Append \x1b[33m`+`\x1b[39;49;00m to include the '
1320 'unspecified address of the selected '
1321 'family:\x1b[37m\x1b[39;49;00m\n'
1322 '\x1b[37m\x1b[39;49;00m\n'
1323 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1324 '\x1b[39;49;00m\x1b[33m`ipv4+`\x1b[39;49;00m: Includes '
1325 '\x1b[33m`0.0.0.0`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1326 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1327 '\x1b[39;49;00m\x1b[33m`ipv6+`\x1b[39;49;00m: Includes '
1328 '\x1b[33m`::`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1329 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
1330 '\x1b[39;49;00m\x1b[33m`all+`\x1b[39;49;00m: Includes both '
1331 '0.0.0.0 and '
1332 '\x1b[33m`::`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n',
1333 'notes': [],
1334 'output': '~ > example --ip-address=<TAB>\n'
1335 '::1 10.0.0.71 127.0.0.1 fe80::f567:7a1a:3c98:808d\n'
1336 '\n'
1337 '~ > example --ip-address-v4=<TAB>\n'
1338 '10.0.0.71 127.0.0.1\n'
1339 '\n'
1340 '~ > example --ip-address-v6=<TAB>\n'
1341 '::1 fe80::f567:7a1a:3c98:808d\n',
1342 'short': 'Complete local IP addresses'},
1343 {'also': {'key_value_list_exec': 'For completing comma-separated lists of '
1344 'key=value pairs (dynamically generated by a '
1345 'function)',
1346 'key_value_pair': 'For completing single key=value pairs',
1347 'list': 'For completing comma-separated lists using a completer',
1348 'value_list': 'For completing comma-separated lists of values'},
1349 'category': 'meta',
1350 'command': 'key_value_list',
1351 'definition': "prog: 'example'\n"
1352 'options:\n'
1353 " - option_strings: ['--key-value-list']\n"
1354 " complete: ['key_value_list', ',', '=', [\n"
1355 " ['flag', 'An option flag', null],\n"
1356 " ['nodesc', null, null],\n"
1357 " ['nocomp', 'An option with arg but without "
1358 "completer', ['none']],\n"
1359 " ['user', 'Takes a username', ['user']],\n"
1360 " ['*repeatable', 'This option is repeatable', null],\n"
1361 " ['exclusive', 'This option disables other options', "
1362 "null, ['flag', 'nodesc', 'nocomp']],\n"
1363 " ['check', 'Specify file name conversions', "
1364 "['choices', {\n"
1365 " 'relaxed': 'convert to lowercase before lookup',\n"
1366 " 'strict': 'no conversion'\n"
1367 ' }]]\n'
1368 ' ]]\n',
1369 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1370 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1371 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1372 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1373 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1374 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--key-value-list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1375 '\x1b[37m '
1376 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1377 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mkey_value_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1378 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m,\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1379 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m=\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1380 '\x1b[39;49;00m[\x1b[37m\x1b[39;49;00m\n'
1381 '\x1b[37m '
1382 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mflag\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1383 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mAn\x1b[39;49;00m\x1b[31m "
1384 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1385 "\x1b[39;49;00m\x1b[33mflag\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1386 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m],\x1b[37m\x1b[39;49;00m\n'
1387 '\x1b[37m '
1388 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnodesc\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1389 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m,\x1b[37m '
1390 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m],\x1b[37m\x1b[39;49;00m\n'
1391 '\x1b[37m '
1392 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnocomp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1393 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mAn\x1b[39;49;00m\x1b[31m "
1394 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1395 '\x1b[39;49;00m\x1b[33mwith\x1b[39;49;00m\x1b[31m '
1396 '\x1b[39;49;00m\x1b[33marg\x1b[39;49;00m\x1b[31m '
1397 '\x1b[39;49;00m\x1b[33mbut\x1b[39;49;00m\x1b[31m '
1398 '\x1b[39;49;00m\x1b[33mwithout\x1b[39;49;00m\x1b[31m '
1399 "\x1b[39;49;00m\x1b[33mcompleter\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1400 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m\x1b[39;49;00m\n"
1401 '\x1b[37m '
1402 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1403 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mTakes\x1b[39;49;00m\x1b[31m "
1404 '\x1b[39;49;00m\x1b[33ma\x1b[39;49;00m\x1b[31m '
1405 "\x1b[39;49;00m\x1b[33musername\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1406 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m\x1b[39;49;00m\n"
1407 '\x1b[37m '
1408 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m*repeatable\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1409 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mThis\x1b[39;49;00m\x1b[31m "
1410 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1411 '\x1b[39;49;00m\x1b[33mis\x1b[39;49;00m\x1b[31m '
1412 "\x1b[39;49;00m\x1b[33mrepeatable\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1413 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m],\x1b[37m\x1b[39;49;00m\n'
1414 '\x1b[37m '
1415 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mexclusive\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1416 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mThis\x1b[39;49;00m\x1b[31m "
1417 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1418 '\x1b[39;49;00m\x1b[33mdisables\x1b[39;49;00m\x1b[31m '
1419 '\x1b[39;49;00m\x1b[33mother\x1b[39;49;00m\x1b[31m '
1420 "\x1b[39;49;00m\x1b[33moptions\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1421 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m,\x1b[37m '
1422 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mflag\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1423 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mnodesc\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1424 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mnocomp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m\x1b[39;49;00m\n"
1425 '\x1b[37m '
1426 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcheck\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1427 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mSpecify\x1b[39;49;00m\x1b[31m "
1428 '\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[31m '
1429 '\x1b[39;49;00m\x1b[33mname\x1b[39;49;00m\x1b[31m '
1430 "\x1b[39;49;00m\x1b[33mconversions\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1431 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1432 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
1433 '\x1b[37m '
1434 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mrelaxed\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1435 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mconvert\x1b[39;49;00m\x1b[31m "
1436 '\x1b[39;49;00m\x1b[33mto\x1b[39;49;00m\x1b[31m '
1437 '\x1b[39;49;00m\x1b[33mlowercase\x1b[39;49;00m\x1b[31m '
1438 '\x1b[39;49;00m\x1b[33mbefore\x1b[39;49;00m\x1b[31m '
1439 "\x1b[39;49;00m\x1b[33mlookup\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m\x1b[39;49;00m\n"
1440 '\x1b[37m '
1441 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mstrict\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1442 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mno\x1b[39;49;00m\x1b[31m "
1443 "\x1b[39;49;00m\x1b[33mconversion\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1444 '\x1b[37m '
1445 '\x1b[39;49;00m}]]\x1b[37m\x1b[39;49;00m\n'
1446 '\x1b[37m \x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n',
1447 'implemented': None,
1448 'long': '`PAIR_SEPARATOR`:\n'
1449 ' The separator used to separate individual key-value pairs.\n'
1450 '\n'
1451 '`VALUE_SEPARATOR`:\n'
1452 ' The separator used to separate a key from its value.\n'
1453 '\n'
1454 '`DEFINITIONS`:\n'
1455 ' A list of key definitions.\n'
1456 '\n'
1457 ' Each definition has one of the following forms:\n'
1458 '\n'
1459 ' `[<KEY>, <DESCRIPTION>, <COMPLETER>]`\n'
1460 ' \n'
1461 ' -- OR --\n'
1462 ' \n'
1463 ' `[<KEY>, <DESCRIPTION>, <COMPLETER>, <EXCLUDES>]`\n'
1464 ' \n'
1465 ' `KEY`:\n'
1466 ' The name of the key.\n'
1467 ' Prefix the name with `*` to allow the key to be completed '
1468 'multiple times.\n'
1469 '\n'
1470 ' `DESCRIPTION`:\n'
1471 ' A description shown during completion.\n'
1472 ' Use `null` to omit the description.\n'
1473 '\n'
1474 ' `COMPLETER`:\n'
1475 ' The completer used for the value of the key.\n'
1476 ' Use `null` if the key does not take an argument.\n'
1477 " Use `['none']` if the key takes an argument but cannot be "
1478 'completed.\n'
1479 '\n'
1480 ' `EXCLUDES`:\n'
1481 ' A list of keys that should no longer be offered for completion '
1482 'once this key has been used.\n'
1483 '\n'
1484 '`CONDITION_FUNCTION`:\n'
1485 ' A command or function that determines whether a key should be '
1486 'offered for\n'
1487 ' completion.\n'
1488 '\n'
1489 ' It is invoked with the key as its first argument. If it exits '
1490 'with status `0`,\n'
1491 ' the key is offered for completion. Any non-zero exit status '
1492 'suppresses the\n'
1493 ' key.\n'
1494 '\n'
1495 'By default, each key is offered for completion only once.\n'
1496 'To allow a key to be completed multiple times, prefix its name with '
1497 '`*`.\n',
1498 'long_colored': '\x1b[33m`PAIR_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1499 ' The separator used to separate individual key-value '
1500 'pairs.\x1b[37m\x1b[39;49;00m\n'
1501 '\n'
1502 '\x1b[33m`VALUE_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1503 ' The separator used to separate a key from its '
1504 'value.\x1b[37m\x1b[39;49;00m\n'
1505 '\n'
1506 '\x1b[33m`DEFINITIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1507 ' A list of key definitions.\x1b[37m\x1b[39;49;00m\n'
1508 '\x1b[37m\x1b[39;49;00m\n'
1509 ' Each definition has one of the following '
1510 'forms:\x1b[37m\x1b[39;49;00m\n'
1511 '\x1b[37m\x1b[39;49;00m\n'
1512 ' \x1b[33m`[<KEY>, <DESCRIPTION>, '
1513 '<COMPLETER>]`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1514 ' \x1b[37m\x1b[39;49;00m\n'
1515 ' -- OR --\x1b[37m\x1b[39;49;00m\n'
1516 ' \x1b[37m\x1b[39;49;00m\n'
1517 ' \x1b[33m`[<KEY>, <DESCRIPTION>, <COMPLETER>, '
1518 '<EXCLUDES>]`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1519 ' \x1b[37m\x1b[39;49;00m\n'
1520 ' \x1b[33m`KEY`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1521 ' The name of the key.\x1b[37m\x1b[39;49;00m\n'
1522 ' Prefix the name with \x1b[33m`*`\x1b[39;49;00m to allow '
1523 'the key to be completed multiple '
1524 'times.\x1b[37m\x1b[39;49;00m\n'
1525 '\x1b[37m\x1b[39;49;00m\n'
1526 ' '
1527 '\x1b[33m`DESCRIPTION`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1528 ' A description shown during '
1529 'completion.\x1b[37m\x1b[39;49;00m\n'
1530 ' Use \x1b[33m`null`\x1b[39;49;00m to omit the '
1531 'description.\x1b[37m\x1b[39;49;00m\n'
1532 '\x1b[37m\x1b[39;49;00m\n'
1533 ' \x1b[33m`COMPLETER`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1534 ' The completer used for the value of the '
1535 'key.\x1b[37m\x1b[39;49;00m\n'
1536 ' Use \x1b[33m`null`\x1b[39;49;00m if the key does not '
1537 'take an argument.\x1b[37m\x1b[39;49;00m\n'
1538 " Use \x1b[33m`['none']`\x1b[39;49;00m if the key takes "
1539 'an argument but cannot be completed.\x1b[37m\x1b[39;49;00m\n'
1540 '\x1b[37m\x1b[39;49;00m\n'
1541 ' \x1b[33m`EXCLUDES`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1542 ' A list of keys that should no longer be offered for '
1543 'completion once this key has been '
1544 'used.\x1b[37m\x1b[39;49;00m\n'
1545 '\n'
1546 '\x1b[33m`CONDITION_FUNCTION`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1547 ' A command or function that determines whether a key '
1548 'should be offered for\x1b[37m\x1b[39;49;00m\n'
1549 ' completion.\x1b[37m\x1b[39;49;00m\n'
1550 '\x1b[37m\x1b[39;49;00m\n'
1551 ' It is invoked with the key as its first argument. If it '
1552 'exits with status '
1553 '\x1b[33m`0`\x1b[39;49;00m,\x1b[37m\x1b[39;49;00m\n'
1554 ' the key is offered for completion. Any non-zero exit '
1555 'status suppresses the\x1b[37m\x1b[39;49;00m\n'
1556 ' key.\x1b[37m\x1b[39;49;00m\n'
1557 '\x1b[37m\x1b[39;49;00m\n'
1558 'By default, each key is offered for completion only '
1559 'once.\x1b[37m\x1b[39;49;00m\n'
1560 'To allow a key to be completed multiple times, prefix its '
1561 'name with '
1562 '\x1b[33m`*`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
1563 'notes': [],
1564 'output': '~ > example --key-value-list flag,user=<TAB>\n'
1565 'bin braph\n'
1566 'colord dbus\n'
1567 'dhcpcd git\n'
1568 '[...]\n',
1569 'short': 'Complete comma-separated lists of key=value pairs'},
1570 {'also': {'key_value_list': 'For completing comma-separated lists of '
1571 'key=value pairs'},
1572 'category': 'custom',
1573 'command': 'key_value_list_exec',
1574 'definition': "prog: 'example'\n"
1575 'options:\n'
1576 " - option_strings: ['-o']\n"
1577 " complete: ['key_value_list_exec', ',', '=', "
1578 "'_complete_key_value_list']\n",
1579 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1580 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1581 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1582 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1583 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1584 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m-o\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1585 '\x1b[37m '
1586 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1587 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mkey_value_list_exec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1588 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m,\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1589 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m=\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1590 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m_complete_key_value_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
1591 'implemented': None,
1592 'long': '`PAIR_SEPARATOR`:\n'
1593 ' The separator used to separate individual key-value pairs.\n'
1594 '\n'
1595 '`VALUE_SEPARATOR`:\n'
1596 ' The separator used to separate a key from its value.\n'
1597 '\n'
1598 '`COMMAND`:\n'
1599 ' The command or function used to generate the available keys and '
1600 'values.\n'
1601 '\n'
1602 ' If invoked without arguments, it must output the available keys '
1603 'in the\n'
1604 ' following format:\n'
1605 '\n'
1606 ' ```\n'
1607 ' [*]<KEY_1>[=][?]\\t<DESCRIPTION_1>\\t<EXCLUDES>\n'
1608 ' [*]<KEY_2>[=][?]\\t<DESCRIPTION_2>\\t<EXCLUDES>\n'
1609 ' [...]\n'
1610 ' ```\n'
1611 '\n'
1612 ' Prefixing a key with `*` marks it as repeatable.\n'
1613 '\n'
1614 ' Appending `=` to a key indicates that it requires a value.\n'
1615 '\n'
1616 ' Appending `=?` to a key indicates that it requires an optional '
1617 'value.\n'
1618 '\n'
1619 ' `EXCLUDES` is a space-separated list of keys that should no '
1620 'longer be\n'
1621 ' offered once the current key has been used.\n'
1622 '\n'
1623 ' If invoked with a single argument, the argument is the selected '
1624 'key.\n'
1625 ' The command must output the possible values for that key in the '
1626 'following\n'
1627 ' format:\n'
1628 '\n'
1629 ' ```\n'
1630 ' <ITEM_1>\\t<DESCRIPTION_1>\n'
1631 ' <ITEM_2>\\t<DESCRIPTION_2>\n'
1632 ' [...]\n'
1633 ' ```\n'
1634 '\n'
1635 ' Each line represents one completion candidate. The item and its '
1636 'description\n'
1637 ' are separated by a tab character.\n'
1638 '\n'
1639 'Example function:\n'
1640 '\n'
1641 '```sh\n'
1642 '_complete_key_value_list() {\n'
1643 ' if (( $# == 0 )); then\n'
1644 " printf '%s\\t%s\\t%s\\n' \\\n"
1645 " 'flag' 'option without an argument' '' \\\n"
1646 " 'argument=' 'option with an argument' '' \\\n"
1647 " 'optional=?' 'option with an optional argument' '' \\\n"
1648 " '*repeatable' 'a repeatable option' '' \\\n"
1649 " 'excludes' 'disable options' 'flag "
1650 "argument'\n"
1651 ' else\n'
1652 " case '$1' in\n"
1653 ' argument|optional)\n'
1654 " printf '%s\\t%s\\n' \\\n"
1655 " 'foo' 'a foo value' \\\n"
1656 " 'bar' 'a bar value';;\n"
1657 ' esac\n'
1658 ' fi\n'
1659 '}\n'
1660 '```\n',
1661 'long_colored': '\x1b[33m`PAIR_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1662 ' The separator used to separate individual key-value '
1663 'pairs.\x1b[37m\x1b[39;49;00m\n'
1664 '\n'
1665 '\x1b[33m`VALUE_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1666 ' The separator used to separate a key from its '
1667 'value.\x1b[37m\x1b[39;49;00m\n'
1668 '\n'
1669 '\x1b[33m`COMMAND`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1670 ' The command or function used to generate the available '
1671 'keys and values.\x1b[37m\x1b[39;49;00m\n'
1672 '\x1b[37m\x1b[39;49;00m\n'
1673 ' If invoked without arguments, it must output the '
1674 'available keys in the\x1b[37m\x1b[39;49;00m\n'
1675 ' following format:\x1b[37m\x1b[39;49;00m\n'
1676 '\x1b[33m\x1b[39;49;00m\n'
1677 '\x1b[33m ```\x1b[39;49;00m\n'
1678 '\x1b[33m '
1679 '[*]<KEY_1>[=][?]\\t<DESCRIPTION_1>\\t<EXCLUDES>\x1b[39;49;00m\n'
1680 '\x1b[33m '
1681 '[*]<KEY_2>[=][?]\\t<DESCRIPTION_2>\\t<EXCLUDES>\x1b[39;49;00m\n'
1682 '\x1b[33m [...]\x1b[39;49;00m\n'
1683 '\x1b[33m ```\x1b[39;49;00m\n'
1684 '\x1b[37m\x1b[39;49;00m\n'
1685 ' Prefixing a key with \x1b[33m`*`\x1b[39;49;00m marks it '
1686 'as repeatable.\x1b[37m\x1b[39;49;00m\n'
1687 '\x1b[37m\x1b[39;49;00m\n'
1688 ' Appending \x1b[33m`=`\x1b[39;49;00m to a key indicates '
1689 'that it requires a value.\x1b[37m\x1b[39;49;00m\n'
1690 '\x1b[37m\x1b[39;49;00m\n'
1691 ' Appending \x1b[33m`=?`\x1b[39;49;00m to a key indicates '
1692 'that it requires an optional value.\x1b[37m\x1b[39;49;00m\n'
1693 '\x1b[37m\x1b[39;49;00m\n'
1694 ' \x1b[33m`EXCLUDES`\x1b[39;49;00m is a space-separated '
1695 'list of keys that should no longer '
1696 'be\x1b[37m\x1b[39;49;00m\n'
1697 ' offered once the current key has been '
1698 'used.\x1b[37m\x1b[39;49;00m\n'
1699 '\x1b[37m\x1b[39;49;00m\n'
1700 ' If invoked with a single argument, the argument is the '
1701 'selected key.\x1b[37m\x1b[39;49;00m\n'
1702 ' The command must output the possible values for that key '
1703 'in the following\x1b[37m\x1b[39;49;00m\n'
1704 ' format:\x1b[37m\x1b[39;49;00m\n'
1705 '\x1b[33m\x1b[39;49;00m\n'
1706 '\x1b[33m ```\x1b[39;49;00m\n'
1707 '\x1b[33m <ITEM_1>\\t<DESCRIPTION_1>\x1b[39;49;00m\n'
1708 '\x1b[33m <ITEM_2>\\t<DESCRIPTION_2>\x1b[39;49;00m\n'
1709 '\x1b[33m [...]\x1b[39;49;00m\n'
1710 '\x1b[33m ```\x1b[39;49;00m\n'
1711 '\x1b[37m\x1b[39;49;00m\n'
1712 ' Each line represents one completion candidate. The item '
1713 'and its description\x1b[37m\x1b[39;49;00m\n'
1714 ' are separated by a tab character.\x1b[37m\x1b[39;49;00m\n'
1715 '\x1b[37m\x1b[39;49;00m\n'
1716 'Example function:\x1b[37m\x1b[39;49;00m\n'
1717 '\x1b[33m\x1b[39;49;00m\n'
1718 '\x1b[33m```\x1b[39;49;00m\x1b[33msh\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1719 '_complete_key_value_list()\x1b[37m '
1720 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
1721 '\x1b[37m \x1b[39;49;00m\x1b[34mif\x1b[39;49;00m\x1b[37m '
1722 '\x1b[39;49;00m((\x1b[37m '
1723 '\x1b[39;49;00m\x1b[31m$#\x1b[39;49;00m\x1b[37m '
1724 '\x1b[39;49;00m==\x1b[37m '
1725 '\x1b[39;49;00m\x1b[34m0\x1b[39;49;00m\x1b[37m '
1726 '\x1b[39;49;00m));\x1b[37m '
1727 '\x1b[39;49;00m\x1b[34mthen\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1728 '\x1b[37m '
1729 '\x1b[39;49;00m\x1b[36mprintf\x1b[39;49;00m\x1b[37m '
1730 "\x1b[39;49;00m\x1b[33m'%s\\t%s\\t%s\\n'\x1b[39;49;00m\x1b[37m "
1731 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1732 '\x1b[37m '
1733 "\x1b[39;49;00m\x1b[33m'flag'\x1b[39;49;00m\x1b[37m "
1734 "\x1b[39;49;00m\x1b[33m'option without an "
1735 "argument'\x1b[39;49;00m\x1b[37m "
1736 "\x1b[39;49;00m\x1b[33m''\x1b[39;49;00m\x1b[37m "
1737 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1738 '\x1b[37m '
1739 "\x1b[39;49;00m\x1b[33m'argument='\x1b[39;49;00m\x1b[37m "
1740 "\x1b[39;49;00m\x1b[33m'option with an "
1741 "argument'\x1b[39;49;00m\x1b[37m "
1742 "\x1b[39;49;00m\x1b[33m''\x1b[39;49;00m\x1b[37m "
1743 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1744 '\x1b[37m '
1745 "\x1b[39;49;00m\x1b[33m'optional=?'\x1b[39;49;00m\x1b[37m "
1746 "\x1b[39;49;00m\x1b[33m'option with an optional "
1747 "argument'\x1b[39;49;00m\x1b[37m "
1748 "\x1b[39;49;00m\x1b[33m''\x1b[39;49;00m\x1b[37m "
1749 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1750 '\x1b[37m '
1751 "\x1b[39;49;00m\x1b[33m'*repeatable'\x1b[39;49;00m\x1b[37m "
1752 "\x1b[39;49;00m\x1b[33m'a repeatable "
1753 "option'\x1b[39;49;00m\x1b[37m "
1754 "\x1b[39;49;00m\x1b[33m''\x1b[39;49;00m\x1b[37m "
1755 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1756 '\x1b[37m '
1757 "\x1b[39;49;00m\x1b[33m'excludes'\x1b[39;49;00m\x1b[37m "
1758 "\x1b[39;49;00m\x1b[33m'disable "
1759 "options'\x1b[39;49;00m\x1b[37m "
1760 "\x1b[39;49;00m\x1b[33m'flag "
1761 "argument'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1762 '\x1b[37m '
1763 '\x1b[39;49;00m\x1b[34melse\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1764 '\x1b[37m '
1765 '\x1b[39;49;00m\x1b[34mcase\x1b[39;49;00m\x1b[37m '
1766 "\x1b[39;49;00m\x1b[33m'$1'\x1b[39;49;00m\x1b[37m "
1767 '\x1b[39;49;00m\x1b[34min\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1768 '\x1b[37m '
1769 '\x1b[39;49;00margument|optional)\x1b[37m\x1b[39;49;00m\n'
1770 '\x1b[37m '
1771 '\x1b[39;49;00m\x1b[36mprintf\x1b[39;49;00m\x1b[37m '
1772 "\x1b[39;49;00m\x1b[33m'%s\\t%s\\n'\x1b[39;49;00m\x1b[37m "
1773 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1774 '\x1b[37m '
1775 "\x1b[39;49;00m\x1b[33m'foo'\x1b[39;49;00m\x1b[37m "
1776 "\x1b[39;49;00m\x1b[33m'a foo value'\x1b[39;49;00m\x1b[37m "
1777 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
1778 '\x1b[37m '
1779 "\x1b[39;49;00m\x1b[33m'bar'\x1b[39;49;00m\x1b[37m "
1780 "\x1b[39;49;00m\x1b[33m'a bar "
1781 "value'\x1b[39;49;00m;;\x1b[37m\x1b[39;49;00m\n"
1782 '\x1b[37m '
1783 '\x1b[39;49;00m\x1b[34mesac\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1784 '\x1b[37m '
1785 '\x1b[39;49;00m\x1b[34mfi\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1786 '}\x1b[37m\x1b[39;49;00m\n'
1787 '\x1b[33m```\x1b[39;49;00m\n',
1788 'notes': ['Functions can be put inside a file and included with '
1789 '`--include-file`'],
1790 'output': '~ > example -o <TAB>\n'
1791 'argument -- option with an argument\n'
1792 'excludes -- disable options\n'
1793 'flag -- option without an argument\n'
1794 'optional -- option with an optional argument\n'
1795 'repeatable -- a repeatable option\n'
1796 '\n'
1797 '~ > example -o argument=<TAB>\n'
1798 'foo -- a foo value\n'
1799 'bar -- a bar value\n'
1800 '\n'
1801 '~ > example -o excludes,<TAB>\n'
1802 'optional -- option with an optional argument\n'
1803 'repeatable -- a repeatable option\n',
1804 'short': 'Complete dynamically generated comma-separted lists of key=value '
1805 'pairs'},
1806 {'also': {'key_value_list': 'For completing comma-separated lists of '
1807 'key=value pairs',
1808 'key_value_pair_exec': 'For completing single key=value pairs '
1809 '(dynamically generated by a function)'},
1810 'category': 'meta',
1811 'command': 'key_value_pair',
1812 'definition': "prog: 'example'\n"
1813 'options:\n'
1814 " - option_strings: ['--key-value-pair']\n"
1815 " complete: ['key_value_pair', '=', [\n"
1816 " ['flag', 'An option flag', null],\n"
1817 " ['nodesc', null, null],\n"
1818 " ['nocomp', 'An option with arg but without completer', "
1819 "['none']],\n"
1820 " ['user', 'Takes a username', ['user']],\n"
1821 " ['check', 'Specify file name conversions', ['choices', "
1822 '{\n'
1823 " 'relaxed': 'convert to lowercase before lookup',\n"
1824 " 'strict': 'no conversion'\n"
1825 ' }]]\n'
1826 ' ]]\n',
1827 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1828 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1829 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1830 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1831 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1832 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--key-value-pair\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1833 '\x1b[37m '
1834 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1835 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mkey_value_pair\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1836 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m=\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1837 '\x1b[39;49;00m[\x1b[37m\x1b[39;49;00m\n'
1838 '\x1b[37m '
1839 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mflag\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1840 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mAn\x1b[39;49;00m\x1b[31m "
1841 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1842 "\x1b[39;49;00m\x1b[33mflag\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1843 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m],\x1b[37m\x1b[39;49;00m\n'
1844 '\x1b[37m '
1845 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnodesc\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1846 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m,\x1b[37m '
1847 '\x1b[39;49;00m\x1b[31mnull\x1b[39;49;00m],\x1b[37m\x1b[39;49;00m\n'
1848 '\x1b[37m '
1849 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnocomp\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1850 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mAn\x1b[39;49;00m\x1b[31m "
1851 '\x1b[39;49;00m\x1b[33moption\x1b[39;49;00m\x1b[31m '
1852 '\x1b[39;49;00m\x1b[33mwith\x1b[39;49;00m\x1b[31m '
1853 '\x1b[39;49;00m\x1b[33marg\x1b[39;49;00m\x1b[31m '
1854 '\x1b[39;49;00m\x1b[33mbut\x1b[39;49;00m\x1b[31m '
1855 '\x1b[39;49;00m\x1b[33mwithout\x1b[39;49;00m\x1b[31m '
1856 "\x1b[39;49;00m\x1b[33mcompleter\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1857 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m\x1b[39;49;00m\n"
1858 '\x1b[37m '
1859 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1860 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mTakes\x1b[39;49;00m\x1b[31m "
1861 '\x1b[39;49;00m\x1b[33ma\x1b[39;49;00m\x1b[31m '
1862 "\x1b[39;49;00m\x1b[33musername\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1863 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m\x1b[39;49;00m\n"
1864 '\x1b[37m '
1865 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mcheck\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1866 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mSpecify\x1b[39;49;00m\x1b[31m "
1867 '\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[31m '
1868 '\x1b[39;49;00m\x1b[33mname\x1b[39;49;00m\x1b[31m '
1869 "\x1b[39;49;00m\x1b[33mconversions\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1870 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1871 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
1872 '\x1b[37m '
1873 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mrelaxed\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1874 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mconvert\x1b[39;49;00m\x1b[31m "
1875 '\x1b[39;49;00m\x1b[33mto\x1b[39;49;00m\x1b[31m '
1876 '\x1b[39;49;00m\x1b[33mlowercase\x1b[39;49;00m\x1b[31m '
1877 '\x1b[39;49;00m\x1b[33mbefore\x1b[39;49;00m\x1b[31m '
1878 "\x1b[39;49;00m\x1b[33mlookup\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m\x1b[39;49;00m\n"
1879 '\x1b[37m '
1880 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mstrict\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
1881 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mno\x1b[39;49;00m\x1b[31m "
1882 "\x1b[39;49;00m\x1b[33mconversion\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1883 '\x1b[37m '
1884 '\x1b[39;49;00m}]]\x1b[37m\x1b[39;49;00m\n'
1885 '\x1b[37m \x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n',
1886 'implemented': None,
1887 'long': '`VALUE_SEPARATOR`:\n'
1888 ' The separator used to separate a key from its value.\n'
1889 '\n'
1890 '`DEFINITIONS`:\n'
1891 ' A list of key definitions.\n'
1892 '\n'
1893 ' Each definition has the following form:\n'
1894 '\n'
1895 ' `[<KEY>, <DESCRIPTION>, <COMPLETER>]`\n'
1896 '\n'
1897 ' `KEY`:\n'
1898 ' The name of the key.\n'
1899 ' Prefix the name with `*` to allow the key to be completed '
1900 'multiple times.\n'
1901 '\n'
1902 ' `DESCRIPTION`:\n'
1903 ' A description shown during completion.\n'
1904 ' Use `null` to omit the description.\n'
1905 '\n'
1906 ' `COMPLETER`:\n'
1907 ' The completer used for the value of the key.\n'
1908 ' Use `null` if the key does not take an argument.\n'
1909 " Use `['none']` if the key takes an argument but cannot be "
1910 'completed.\n'
1911 '\n'
1912 '`CONDITION_FUNCTION`:\n'
1913 ' A command or function that determines whether a key should be '
1914 'offered for\n'
1915 ' completion.\n'
1916 '\n'
1917 ' It is invoked with the key as its first argument. If it exits '
1918 'with status `0`,\n'
1919 ' the key is offered for completion. Any non-zero exit status '
1920 'suppresses the\n'
1921 ' key.\n',
1922 'long_colored': '\x1b[33m`VALUE_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1923 ' The separator used to separate a key from its '
1924 'value.\x1b[37m\x1b[39;49;00m\n'
1925 '\n'
1926 '\x1b[33m`DEFINITIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1927 ' A list of key definitions.\x1b[37m\x1b[39;49;00m\n'
1928 '\x1b[37m\x1b[39;49;00m\n'
1929 ' Each definition has the following '
1930 'form:\x1b[37m\x1b[39;49;00m\n'
1931 '\x1b[37m\x1b[39;49;00m\n'
1932 ' \x1b[33m`[<KEY>, <DESCRIPTION>, '
1933 '<COMPLETER>]`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
1934 '\x1b[37m\x1b[39;49;00m\n'
1935 ' \x1b[33m`KEY`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1936 ' The name of the key.\x1b[37m\x1b[39;49;00m\n'
1937 ' Prefix the name with \x1b[33m`*`\x1b[39;49;00m to allow '
1938 'the key to be completed multiple '
1939 'times.\x1b[37m\x1b[39;49;00m\n'
1940 '\x1b[37m\x1b[39;49;00m\n'
1941 ' '
1942 '\x1b[33m`DESCRIPTION`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1943 ' A description shown during '
1944 'completion.\x1b[37m\x1b[39;49;00m\n'
1945 ' Use \x1b[33m`null`\x1b[39;49;00m to omit the '
1946 'description.\x1b[37m\x1b[39;49;00m\n'
1947 '\x1b[37m\x1b[39;49;00m\n'
1948 ' \x1b[33m`COMPLETER`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1949 ' The completer used for the value of the '
1950 'key.\x1b[37m\x1b[39;49;00m\n'
1951 ' Use \x1b[33m`null`\x1b[39;49;00m if the key does not '
1952 'take an argument.\x1b[37m\x1b[39;49;00m\n'
1953 " Use \x1b[33m`['none']`\x1b[39;49;00m if the key takes "
1954 'an argument but cannot be completed.\x1b[37m\x1b[39;49;00m\n'
1955 '\n'
1956 '\x1b[33m`CONDITION_FUNCTION`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1957 ' A command or function that determines whether a key '
1958 'should be offered for\x1b[37m\x1b[39;49;00m\n'
1959 ' completion.\x1b[37m\x1b[39;49;00m\n'
1960 '\x1b[37m\x1b[39;49;00m\n'
1961 ' It is invoked with the key as its first argument. If it '
1962 'exits with status '
1963 '\x1b[33m`0`\x1b[39;49;00m,\x1b[37m\x1b[39;49;00m\n'
1964 ' the key is offered for completion. Any non-zero exit '
1965 'status suppresses the\x1b[37m\x1b[39;49;00m\n'
1966 ' key.\x1b[37m\x1b[39;49;00m\n',
1967 'notes': [],
1968 'output': '~ > example --key-value-pair <TAB>\n'
1969 'check -- Specify file name conversions\n'
1970 'flag -- An option flag\n'
1971 'nocomp -- An option with arg but without completer\n'
1972 'user -- Takes a username\n'
1973 'nodesc\n'
1974 '\n'
1975 '~ > example --key-value-pair user=<TAB>\n'
1976 'bin braph\n'
1977 'colord dbus\n'
1978 'dhcpcd git\n'
1979 '[...]\n',
1980 'short': 'Complete single key=value pairs'},
1981 {'also': {'key_value_pair': 'For completing single key=value pairs'},
1982 'category': 'custom',
1983 'command': 'key_value_pair_exec',
1984 'definition': "prog: 'example'\n"
1985 'options:\n'
1986 " - option_strings: ['-o']\n"
1987 " complete: ['key_value_pair_exec', '=', "
1988 "'_complete_key_value_pair']\n",
1989 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
1990 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
1991 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
1992 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
1993 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
1994 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m-o\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
1995 '\x1b[37m '
1996 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
1997 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mkey_value_pair_exec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1998 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m=\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
1999 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m_complete_key_value_pair\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2000 'implemented': None,
2001 'long': '`VALUE_SEPARATOR`:\n'
2002 ' The separator used to separate a key from its value.\n'
2003 '\n'
2004 '`COMMAND`:\n'
2005 ' The command or function used to generate the available keys and '
2006 'values.\n'
2007 '\n'
2008 ' If invoked without arguments, it must output the available keys '
2009 'in the\n'
2010 ' following format:\n'
2011 '\n'
2012 ' ```\n'
2013 ' <KEY_1>[=]\\t<DESCRIPTION_1>\n'
2014 ' <KEY_2>[=]\\t<DESCRIPTION_2>\n'
2015 ' [...]\n'
2016 ' ```\n'
2017 '\n'
2018 ' Appending `=` to a key indicates that it requires a value.\n'
2019 '\n'
2020 ' If invoked with a single argument, the argument is the selected '
2021 'key. The\n'
2022 ' command must output the possible values for that key in the '
2023 'following\n'
2024 ' format:\n'
2025 '\n'
2026 ' ```\n'
2027 ' <ITEM_1>\\t<DESCRIPTION_1>\n'
2028 ' <ITEM_2>\\t<DESCRIPTION_2>\n'
2029 ' [...]\n'
2030 ' ```\n'
2031 '\n'
2032 ' Each line represents one completion candidate. The item and its '
2033 'description\n'
2034 ' are separated by a tab character.\n'
2035 '\n'
2036 'Example function:\n'
2037 '\n'
2038 '```sh\n'
2039 '_complete_key_value_pair() {\n'
2040 ' if (( $# == 0 )); then\n'
2041 " printf '%s\\t%s\\n' \\\n"
2042 " 'flag' 'a flag' \\\n"
2043 " 'option=' 'option with value'\n"
2044 ' else\n'
2045 " case '$1' in\n"
2046 ' option)\n'
2047 " printf '%s\\t%s\\n' \\\n"
2048 " 'foo' 'a foo value' \\\n"
2049 " 'bar' 'a bar value';;\n"
2050 ' esac\n'
2051 ' fi\n'
2052 '}\n'
2053 '```\n',
2054 'long_colored': '\x1b[33m`VALUE_SEPARATOR`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2055 ' The separator used to separate a key from its '
2056 'value.\x1b[37m\x1b[39;49;00m\n'
2057 '\n'
2058 '\x1b[33m`COMMAND`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2059 ' The command or function used to generate the available '
2060 'keys and values.\x1b[37m\x1b[39;49;00m\n'
2061 '\x1b[37m\x1b[39;49;00m\n'
2062 ' If invoked without arguments, it must output the '
2063 'available keys in the\x1b[37m\x1b[39;49;00m\n'
2064 ' following format:\x1b[37m\x1b[39;49;00m\n'
2065 '\x1b[33m\x1b[39;49;00m\n'
2066 '\x1b[33m ```\x1b[39;49;00m\n'
2067 '\x1b[33m <KEY_1>[=]\\t<DESCRIPTION_1>\x1b[39;49;00m\n'
2068 '\x1b[33m <KEY_2>[=]\\t<DESCRIPTION_2>\x1b[39;49;00m\n'
2069 '\x1b[33m [...]\x1b[39;49;00m\n'
2070 '\x1b[33m ```\x1b[39;49;00m\n'
2071 '\x1b[37m\x1b[39;49;00m\n'
2072 ' Appending \x1b[33m`=`\x1b[39;49;00m to a key indicates '
2073 'that it requires a value.\x1b[37m\x1b[39;49;00m\n'
2074 '\x1b[37m\x1b[39;49;00m\n'
2075 ' If invoked with a single argument, the argument is the '
2076 'selected key. The\x1b[37m\x1b[39;49;00m\n'
2077 ' command must output the possible values for that key in '
2078 'the following\x1b[37m\x1b[39;49;00m\n'
2079 ' format:\x1b[37m\x1b[39;49;00m\n'
2080 '\x1b[33m\x1b[39;49;00m\n'
2081 '\x1b[33m ```\x1b[39;49;00m\n'
2082 '\x1b[33m <ITEM_1>\\t<DESCRIPTION_1>\x1b[39;49;00m\n'
2083 '\x1b[33m <ITEM_2>\\t<DESCRIPTION_2>\x1b[39;49;00m\n'
2084 '\x1b[33m [...]\x1b[39;49;00m\n'
2085 '\x1b[33m ```\x1b[39;49;00m\n'
2086 '\x1b[37m\x1b[39;49;00m\n'
2087 ' Each line represents one completion candidate. The item '
2088 'and its description\x1b[37m\x1b[39;49;00m\n'
2089 ' are separated by a tab character.\x1b[37m\x1b[39;49;00m\n'
2090 '\x1b[37m\x1b[39;49;00m\n'
2091 'Example function:\x1b[37m\x1b[39;49;00m\n'
2092 '\x1b[33m\x1b[39;49;00m\n'
2093 '\x1b[33m```\x1b[39;49;00m\x1b[33msh\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2094 '_complete_key_value_pair()\x1b[37m '
2095 '\x1b[39;49;00m{\x1b[37m\x1b[39;49;00m\n'
2096 '\x1b[37m \x1b[39;49;00m\x1b[34mif\x1b[39;49;00m\x1b[37m '
2097 '\x1b[39;49;00m((\x1b[37m '
2098 '\x1b[39;49;00m\x1b[31m$#\x1b[39;49;00m\x1b[37m '
2099 '\x1b[39;49;00m==\x1b[37m '
2100 '\x1b[39;49;00m\x1b[34m0\x1b[39;49;00m\x1b[37m '
2101 '\x1b[39;49;00m));\x1b[37m '
2102 '\x1b[39;49;00m\x1b[34mthen\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2103 '\x1b[37m '
2104 '\x1b[39;49;00m\x1b[36mprintf\x1b[39;49;00m\x1b[37m '
2105 "\x1b[39;49;00m\x1b[33m'%s\\t%s\\n'\x1b[39;49;00m\x1b[37m "
2106 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
2107 '\x1b[37m '
2108 "\x1b[39;49;00m\x1b[33m'flag'\x1b[39;49;00m\x1b[37m "
2109 "\x1b[39;49;00m\x1b[33m'a flag'\x1b[39;49;00m\x1b[37m "
2110 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
2111 '\x1b[37m '
2112 "\x1b[39;49;00m\x1b[33m'option='\x1b[39;49;00m\x1b[37m "
2113 "\x1b[39;49;00m\x1b[33m'option with "
2114 "value'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2115 '\x1b[37m '
2116 '\x1b[39;49;00m\x1b[34melse\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2117 '\x1b[37m '
2118 '\x1b[39;49;00m\x1b[34mcase\x1b[39;49;00m\x1b[37m '
2119 "\x1b[39;49;00m\x1b[33m'$1'\x1b[39;49;00m\x1b[37m "
2120 '\x1b[39;49;00m\x1b[34min\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2121 '\x1b[37m \x1b[39;49;00moption)\x1b[37m\x1b[39;49;00m\n'
2122 '\x1b[37m '
2123 '\x1b[39;49;00m\x1b[36mprintf\x1b[39;49;00m\x1b[37m '
2124 "\x1b[39;49;00m\x1b[33m'%s\\t%s\\n'\x1b[39;49;00m\x1b[37m "
2125 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
2126 '\x1b[37m '
2127 "\x1b[39;49;00m\x1b[33m'foo'\x1b[39;49;00m\x1b[37m "
2128 "\x1b[39;49;00m\x1b[33m'a foo value'\x1b[39;49;00m\x1b[37m "
2129 '\x1b[39;49;00m\x1b[33m\\\x1b[39;49;00m\n'
2130 '\x1b[37m '
2131 "\x1b[39;49;00m\x1b[33m'bar'\x1b[39;49;00m\x1b[37m "
2132 "\x1b[39;49;00m\x1b[33m'a bar "
2133 "value'\x1b[39;49;00m;;\x1b[37m\x1b[39;49;00m\n"
2134 '\x1b[37m '
2135 '\x1b[39;49;00m\x1b[34mesac\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2136 '\x1b[37m '
2137 '\x1b[39;49;00m\x1b[34mfi\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2138 '}\x1b[37m\x1b[39;49;00m\n'
2139 '\x1b[33m```\x1b[39;49;00m\n',
2140 'notes': ['Functions can be put inside a file and included with '
2141 '`--include-file`'],
2142 'output': '~ > example -o <TAB>\n'
2143 'flag -- a flag\n'
2144 'option -- option with value\n'
2145 '\n'
2146 '~ > example -o option=<TAB>\n'
2147 'foo -- a foo value\n'
2148 'bar -- a bar value\n',
2149 'short': 'Complete dynamically generated a key=value pairs'},
2150 {'also': {'directory_list': 'For completing comma-separated lists of '
2151 'directories',
2152 'file_list': 'For completing comma-separated lists of files',
2153 'key_value_list': 'For completing comma-separated lists of '
2154 'key=value pairs',
2155 'value_list': 'For completing comma-separated lists of values'},
2156 'category': 'meta',
2157 'command': 'list',
2158 'definition': "prog: 'example'\n"
2159 'options:\n'
2160 " - option_strings: ['--user-list']\n"
2161 " complete: ['list', ['user']]\n"
2162 '\n'
2163 " - option_strings: ['--option-list']\n"
2164 " complete: ['list', ['choices', ['setuid', 'async', "
2165 "'block']], {'separator': ':', 'duplicates': true}]\n",
2166 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2167 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2168 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2169 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2170 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2171 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--user-list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2172 '\x1b[37m '
2173 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2174 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mlist\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2175 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n"
2176 '\x1b[37m\x1b[39;49;00m\n'
2177 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2178 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2179 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--option-list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2180 '\x1b[37m '
2181 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2182 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mlist\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2183 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mchoices\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2184 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33msetuid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2185 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33masync\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2186 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mblock\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]],\x1b[37m "
2187 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mseparator\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2188 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33m:\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2189 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mduplicates\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2190 '\x1b[39;49;00m\x1b[31mtrue\x1b[39;49;00m}]\x1b[37m\x1b[39;49;00m\n',
2191 'implemented': None,
2192 'long': '`COMPLETER`:\n'
2193 ' The completer used to generate the list elements.\n'
2194 '\n'
2195 '`OPTIONS`:\n'
2196 ' A dictionary containing additional options for configuring the '
2197 'list completion.\n'
2198 '\n'
2199 ' - `separator`: The separator used between list elements. Defaults '
2200 'to `,`\n'
2201 '\n'
2202 ' - `duplicates`: Allow duplicate values to be offered for '
2203 'completion. Defaults to `false`\n',
2204 'long_colored': '\x1b[33m`COMPLETER`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2205 ' The completer used to generate the list '
2206 'elements.\x1b[37m\x1b[39;49;00m\n'
2207 '\n'
2208 '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2209 ' A dictionary containing additional options for '
2210 'configuring the list completion.\x1b[37m\x1b[39;49;00m\n'
2211 '\x1b[37m\x1b[39;49;00m\n'
2212 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
2213 '\x1b[39;49;00m\x1b[33m`separator`\x1b[39;49;00m: The '
2214 'separator used between list elements. Defaults to '
2215 '\x1b[33m`,`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n'
2216 '\x1b[37m\x1b[39;49;00m\n'
2217 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
2218 '\x1b[39;49;00m\x1b[33m`duplicates`\x1b[39;49;00m: Allow '
2219 'duplicate values to be offered for completion. Defaults to '
2220 '\x1b[33m`false`\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n',
2221 'notes': [],
2222 'output': '~ > example --user-list=avahi,daemon,<TAB>\n'
2223 'bin braph\n'
2224 'colord dbus\n'
2225 'dhcpcd git\n'
2226 '[...]\n'
2227 '\n'
2228 '~ > example --option-list=setuid:<TAB>\n'
2229 'setuid async block\n',
2230 'short': 'Complete comma-separated lists using a completer'},
2231 {'also': None,
2232 'category': 'bonus',
2233 'command': 'locale',
2234 'definition': "prog: 'example'\n"
2235 'options:\n'
2236 " - option_strings: ['--locale']\n"
2237 " complete: ['locale']\n",
2238 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2239 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2240 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2241 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2242 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2243 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--locale\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2244 '\x1b[37m '
2245 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2246 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mlocale\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2247 'implemented': None,
2248 'long': None,
2249 'long_colored': None,
2250 'notes': [],
2251 'output': '~ > example --locale=<TAB>\n'
2252 'C C.UTF-8 de_DE de_DE@euro de_DE.iso88591 '
2253 'de_DE.iso885915@euro\n'
2254 'de_DE.UTF-8 deutsch en_US en_US.iso88591 en_US.UTF-8 german '
2255 'POSIX\n',
2256 'short': 'Complete locales'},
2257 {'also': None,
2258 'category': 'bonus',
2259 'command': 'login_shell',
2260 'definition': "prog: 'example'\n"
2261 'options:\n'
2262 " - option_strings: ['--login-shell']\n"
2263 " complete: ['login_shell']\n",
2264 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2265 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2266 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2267 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2268 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2269 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--login-shell\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2270 '\x1b[37m '
2271 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2272 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mlogin_shell\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2273 'implemented': None,
2274 'long': None,
2275 'long_colored': None,
2276 'notes': [],
2277 'output': '~ > example --login-shell=<TAB>\n'
2278 '/bin/bash /bin/sh /usr/bin/fish /usr/bin/sh\n'
2279 '[...]\n',
2280 'short': 'Complete login shells'},
2281 {'also': None,
2282 'category': 'basic',
2283 'command': 'mime_file',
2284 'definition': "prog: 'example'\n"
2285 'options:\n'
2286 " - option_strings: ['--image']\n"
2287 " complete: ['mime_file', 'image/']\n",
2288 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2289 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2290 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2291 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2292 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2293 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--image\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2294 '\x1b[37m '
2295 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2296 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mmime_file\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2297 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mimage/\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2298 'implemented': None,
2299 'long': '`MIME_REGEX`:\n'
2300 ' An extended regular expression used to match MIME types.\n'
2301 ' The expression is passed to `grep -E` to filter the results.\n',
2302 'long_colored': '\x1b[33m`MIME_REGEX`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2303 ' An extended regular expression used to match MIME '
2304 'types.\x1b[37m\x1b[39;49;00m\n'
2305 ' The expression is passed to \x1b[33m`grep '
2306 '-E`\x1b[39;49;00m to filter the '
2307 'results.\x1b[37m\x1b[39;49;00m\n',
2308 'notes': [],
2309 'output': '~ > example --image=<TAB>\ndir1/ dir2/ img.png img.jpg\n',
2310 'short': 'Complete files by MIME type'},
2311 {'also': None,
2312 'category': 'bonus',
2313 'command': 'mountpoint',
2314 'definition': "prog: 'example'\n"
2315 'options:\n'
2316 " - option_strings: ['--mountpoint']\n"
2317 " complete: ['mountpoint']\n",
2318 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2319 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2320 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2321 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2322 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2323 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--mountpoint\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2324 '\x1b[37m '
2325 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2326 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mmountpoint\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2327 'implemented': None,
2328 'long': None,
2329 'long_colored': None,
2330 'notes': [],
2331 'output': '~ > example --mountpoint=<TAB>\n'
2332 '/ /boot /home /proc /run /sys /tmp\n'
2333 '[...]\n',
2334 'short': 'Complete mount points'},
2335 {'also': {'ip_address': 'For completing IP addresses'},
2336 'category': 'bonus',
2337 'command': 'net_interface',
2338 'definition': "prog: 'example'\n"
2339 'options:\n'
2340 " - option_strings: ['--net-interface']\n"
2341 " complete: ['net_interface']\n",
2342 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2343 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2344 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2345 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2346 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2347 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--net-interface\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2348 '\x1b[37m '
2349 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2350 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnet_interface\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2351 'implemented': None,
2352 'long': None,
2353 'long_colored': None,
2354 'notes': [],
2355 'output': '~ > example --net-interface=<TAB>\n'
2356 'eno1 enp1s0 lo wlo1 wlp2s0\n'
2357 '[...]\n',
2358 'short': 'Complete network interfaces'},
2359 {'also': None,
2360 'category': 'meta',
2361 'command': 'none',
2362 'definition': "prog: 'example'\n"
2363 'options:\n'
2364 " - option_strings: ['--none']\n"
2365 " complete: ['none']\n",
2366 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2367 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2368 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2369 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2370 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2371 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--none\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2372 '\x1b[37m '
2373 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2374 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mnone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2375 'implemented': None,
2376 'long': 'Disables autocompletion for an option but still marks it as '
2377 'requiring an argument.\n'
2378 '\n'
2379 'Without specifying `complete`, the option would not take an '
2380 'argument.\n',
2381 'long_colored': 'Disables autocompletion for an option but still marks it as '
2382 'requiring an argument.\x1b[37m\x1b[39;49;00m\n'
2383 '\x1b[37m\x1b[39;49;00m\n'
2384 'Without specifying \x1b[33m`complete`\x1b[39;49;00m, the '
2385 'option would not take an argument.\x1b[37m\x1b[39;49;00m\n',
2386 'notes': [],
2387 'output': '~ > example --none=<TAB>\n<NO OUTPUT>\n',
2388 'short': 'No completion, but specify that an argument is required'},
2389 {'also': {'process': 'For completing process names'},
2390 'category': 'basic',
2391 'command': 'pid',
2392 'definition': "prog: 'example'\n"
2393 'options:\n'
2394 " - option_strings: ['--pid']\n"
2395 " complete: ['pid']\n",
2396 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2397 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2398 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2399 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2400 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2401 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--pid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2402 '\x1b[37m '
2403 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2404 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mpid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2405 'implemented': None,
2406 'long': None,
2407 'long_colored': None,
2408 'notes': [],
2409 'output': '~ > example --pid=<TAB>\n'
2410 '1 13 166 19 254 31 45\n'
2411 '1006 133315 166441 19042 26 32 46\n'
2412 '10150 1392 166442 195962 27 33 4609\n',
2413 'short': 'Complete process IDs'},
2414 {'also': None,
2415 'category': 'meta',
2416 'command': 'prefix',
2417 'definition': "prog: 'example'\n"
2418 'options:\n'
2419 " - option_strings: ['--prefix']\n"
2420 " complete: ['prefix', 'input:', ['file']]\n",
2421 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2422 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2423 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2424 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2425 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2426 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--prefix\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2427 '\x1b[37m '
2428 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2429 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mprefix\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2430 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33minput:\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2431 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mfile\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]]\x1b[37m\x1b[39;49;00m\n",
2432 'implemented': None,
2433 'long': '`PREFIX`:\n'
2434 ' The string to prepend to each completion candidate.\n'
2435 '\n'
2436 '`COMPLETER`:\n'
2437 ' The completer used to generate the completion candidates.\n',
2438 'long_colored': '\x1b[33m`PREFIX`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2439 ' The string to prepend to each completion '
2440 'candidate.\x1b[37m\x1b[39;49;00m\n'
2441 '\n'
2442 '\x1b[33m`COMPLETER`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2443 ' The completer used to generate the completion '
2444 'candidates.\x1b[37m\x1b[39;49;00m\n',
2445 'notes': [],
2446 'output': '~ > example --prefix=<TAB>\n'
2447 '~ > example --prefix=input:\n'
2448 '\n'
2449 '~ > example --prefix=input:<TAB>\n'
2450 '~ > example --prefix=input:file1.txt\n',
2451 'short': 'Prefix completions with a string'},
2452 {'also': {'pid': 'For completing process IDs'},
2453 'category': 'basic',
2454 'command': 'process',
2455 'definition': "prog: 'example'\n"
2456 'options:\n'
2457 " - option_strings: ['--process']\n"
2458 " complete: ['process']\n",
2459 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2460 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2461 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2462 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2463 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2464 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--process\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2465 '\x1b[37m '
2466 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2467 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mprocess\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2468 'implemented': None,
2469 'long': None,
2470 'long_colored': None,
2471 'notes': [],
2472 'output': '~ > example --process=s<TAB>\n'
2473 'scsi_eh_0 scsi_eh_1 scsi_eh_2 scsi_eh_3 '
2474 'scsi_eh_4\n'
2475 'scsi_eh_5 sh sudo syndaemon '
2476 'systemd\n'
2477 'systemd-journald systemd-logind systemd-udevd\n',
2478 'short': 'Complete process names'},
2479 {'also': None,
2480 'category': 'basic',
2481 'command': 'range',
2482 'definition': "prog: 'example'\n"
2483 'options:\n'
2484 " - option_strings: ['--range-1']\n"
2485 " complete: ['range', 1, 9]\n"
2486 '\n'
2487 " - option_strings: ['--range-2']\n"
2488 " complete: ['range', 1, 9, 2]\n",
2489 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2490 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2491 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2492 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2493 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2494 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--range-1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2495 '\x1b[37m '
2496 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2497 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mrange\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2498 '\x1b[39;49;00m\x1b[31m1\x1b[39;49;00m,\x1b[37m '
2499 '\x1b[39;49;00m\x1b[31m9\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n'
2500 '\x1b[37m\x1b[39;49;00m\n'
2501 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2502 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2503 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--range-2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2504 '\x1b[37m '
2505 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2506 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mrange\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2507 '\x1b[39;49;00m\x1b[31m1\x1b[39;49;00m,\x1b[37m '
2508 '\x1b[39;49;00m\x1b[31m9\x1b[39;49;00m,\x1b[37m '
2509 '\x1b[39;49;00m\x1b[31m2\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n',
2510 'implemented': None,
2511 'long': '`START`:\n'
2512 ' The first value of the range.\n'
2513 '\n'
2514 '`STOP`:\n'
2515 ' The last value of the range.\n'
2516 '\n'
2517 '`STEP`:\n'
2518 ' The increment between values. Defaults to `1`.\n',
2519 'long_colored': '\x1b[33m`START`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2520 ' The first value of the range.\x1b[37m\x1b[39;49;00m\n'
2521 '\n'
2522 '\x1b[33m`STOP`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2523 ' The last value of the range.\x1b[37m\x1b[39;49;00m\n'
2524 '\n'
2525 '\x1b[33m`STEP`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2526 ' The increment between values. Defaults to '
2527 '\x1b[33m`1`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
2528 'notes': [],
2529 'output': '~ > example --range-1=<TAB>\n'
2530 '1 2 3 4 5 6 7 8 9\n'
2531 '\n'
2532 '~ > example --range-2=<TAB>\n'
2533 '1 3 5 7 9\n',
2534 'short': 'Complete sequences of integers'},
2535 {'also': None,
2536 'category': 'basic',
2537 'command': 'service',
2538 'definition': "prog: 'example'\n"
2539 'options:\n'
2540 " - option_strings: ['--service']\n"
2541 " complete: ['service']\n",
2542 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2543 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2544 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2545 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2546 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2547 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--service\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2548 '\x1b[37m '
2549 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2550 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mservice\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2551 'implemented': None,
2552 'long': None,
2553 'long_colored': None,
2554 'notes': [],
2555 'output': '~ > example --service=<TAB>\nTODO\n[...]\n',
2556 'short': 'Complete systemd service names'},
2557 {'also': None,
2558 'category': 'basic',
2559 'command': 'signal',
2560 'definition': "prog: 'example'\n"
2561 'options:\n'
2562 " - option_strings: ['--signal']\n"
2563 " complete: ['signal']\n",
2564 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2565 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2566 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2567 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2568 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2569 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--signal\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2570 '\x1b[37m '
2571 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2572 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33msignal\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2573 'implemented': None,
2574 'long': None,
2575 'long_colored': None,
2576 'notes': [],
2577 'output': '~ > example --signal=<TAB>\n'
2578 'ABRT -- Process abort signal\n'
2579 'ALRM -- Alarm clock\n'
2580 'BUS -- Access to an undefined portion of a memory object\n'
2581 'CHLD -- Child process terminated, stopped, or continued\n'
2582 'CONT -- Continue executing, if stopped\n'
2583 'FPE -- Erroneous arithmetic operation\n'
2584 'HUP -- Hangup\n'
2585 'ILL -- Illegal instruction\n'
2586 'INT -- Terminal interrupt signal\n'
2587 '[...]\n',
2588 'short': 'Complete signal names'},
2589 {'also': None,
2590 'category': 'bonus',
2591 'command': 'timezone',
2592 'definition': "prog: 'example'\n"
2593 'options:\n'
2594 " - option_strings: ['--timezone']\n"
2595 " complete: ['timezone']\n",
2596 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2597 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2598 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2599 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2600 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2601 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--timezone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2602 '\x1b[37m '
2603 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2604 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mtimezone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2605 'implemented': None,
2606 'long': None,
2607 'long_colored': None,
2608 'notes': [],
2609 'output': '~ > example --timezone=Europe/B<TAB>\n'
2610 'Belfast Belgrade Berlin Bratislava\n'
2611 'Brussels Bucharest Budapest Busingen\n',
2612 'short': 'Complete timezones'},
2613 {'also': {'user': 'For completing user names'},
2614 'category': 'basic',
2615 'command': 'uid',
2616 'definition': "prog: 'example'\n"
2617 'options:\n'
2618 " - option_strings: ['--uid']\n"
2619 " complete: ['uid']\n",
2620 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2621 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2622 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2623 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2624 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2625 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--uid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2626 '\x1b[37m '
2627 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2628 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muid\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2629 'implemented': None,
2630 'long': None,
2631 'long_colored': None,
2632 'notes': [],
2633 'output': '~ > example --uid=<TAB>\n'
2634 '0 -- root\n'
2635 '1000 -- braph\n'
2636 '102 -- polkitd\n'
2637 '133 -- rtkit\n'
2638 '14 -- ftp\n'
2639 '1 -- bin\n'
2640 '2 -- daemon\n'
2641 '33 -- http\n'
2642 '65534 -- nobody\n'
2643 '[...]\n',
2644 'short': 'Complete user IDs'},
2645 {'also': {'uid': 'For completing user IDs'},
2646 'category': 'basic',
2647 'command': 'user',
2648 'definition': "prog: 'example'\n"
2649 'options:\n'
2650 " - option_strings: ['--user']\n"
2651 " complete: ['user']\n",
2652 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2653 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2654 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2655 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2656 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2657 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--user\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2658 '\x1b[37m '
2659 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2660 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33muser\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2661 'implemented': None,
2662 'long': None,
2663 'long_colored': None,
2664 'notes': [],
2665 'output': '~ > example --user=<TAB>\n'
2666 'avahi bin braph\n'
2667 'colord daemon dbus\n'
2668 'dhcpcd ftp git\n'
2669 '[...]\n',
2670 'short': 'Complete user names'},
2671 {'also': {'key_value_list': 'For completing comma-separated lists of '
2672 'key=value pairs',
2673 'list': 'For completing comma-separated lists using a completer'},
2674 'category': 'basic',
2675 'command': 'value_list',
2676 'definition': "prog: 'example'\n"
2677 'options:\n'
2678 " - option_strings: ['--value-list-1']\n"
2679 " complete: ['value_list', {'values': ['exec', 'noexec']}]\n"
2680 '\n'
2681 " - option_strings: ['--value-list-2']\n"
2682 " complete: ['value_list', {'values': {'one': 'Description "
2683 "1', 'two': 'Description 2'}}]\n",
2684 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2685 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2686 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2687 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2688 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2689 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--value-list-1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2690 '\x1b[37m '
2691 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2692 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mvalue_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2693 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mvalues\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2694 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mexec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2695 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mnoexec\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]}]\x1b[37m\x1b[39;49;00m\n"
2696 '\x1b[37m\x1b[39;49;00m\n'
2697 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2698 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2699 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--value-list-2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2700 '\x1b[37m '
2701 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2702 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mvalue_list\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2703 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mvalues\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2704 "\x1b[39;49;00m{\x1b[33m'\x1b[39;49;00m\x1b[33mone\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2705 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mDescription\x1b[39;49;00m\x1b[31m "
2706 "\x1b[39;49;00m\x1b[33m1\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m,\x1b[37m "
2707 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mtwo\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m:\x1b[37m "
2708 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mDescription\x1b[39;49;00m\x1b[31m "
2709 "\x1b[39;49;00m\x1b[33m2\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m}}]\x1b[37m\x1b[39;49;00m\n",
2710 'implemented': None,
2711 'long': '`OPTIONS`:\n'
2712 ' A dictionary containing additional options for configuring the '
2713 'completion.\n'
2714 '\n'
2715 ' - `values`:\n'
2716 ' A list or dictionary containing the values to offer for '
2717 'completion.\n'
2718 '\n'
2719 ' If a list is supplied, all values are offered without '
2720 'descriptions.\n'
2721 '\n'
2722 ' If a dictionary is supplied, the keys are used as completion '
2723 'values and\n'
2724 ' the values are used as descriptions.\n'
2725 '\n'
2726 ' - `separator`:\n'
2727 ' The separator used between list elements. Defaults to `,`.\n'
2728 '\n'
2729 ' - `duplicates`:\n'
2730 ' Allow duplicate values to be offered for completion. Defaults '
2731 'to `false`.\n',
2732 'long_colored': '\x1b[33m`OPTIONS`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2733 ' A dictionary containing additional options for '
2734 'configuring the completion.\x1b[37m\x1b[39;49;00m\n'
2735 '\x1b[37m\x1b[39;49;00m\n'
2736 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
2737 '\x1b[39;49;00m\x1b[33m`values`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2738 ' A list or dictionary containing the values to offer for '
2739 'completion.\x1b[37m\x1b[39;49;00m\n'
2740 '\x1b[37m\x1b[39;49;00m\n'
2741 ' If a list is supplied, all values are offered without '
2742 'descriptions.\x1b[37m\x1b[39;49;00m\n'
2743 '\x1b[37m\x1b[39;49;00m\n'
2744 ' If a dictionary is supplied, the keys are used as '
2745 'completion values and\x1b[37m\x1b[39;49;00m\n'
2746 ' the values are used as '
2747 'descriptions.\x1b[37m\x1b[39;49;00m\n'
2748 '\x1b[37m\x1b[39;49;00m\n'
2749 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
2750 '\x1b[39;49;00m\x1b[33m`separator`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2751 ' The separator used between list elements. Defaults to '
2752 '\x1b[33m`,`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n'
2753 '\x1b[37m\x1b[39;49;00m\n'
2754 '\x1b[37m \x1b[39;49;00m\x1b[34m-\x1b[39;49;00m\x1b[37m '
2755 '\x1b[39;49;00m\x1b[33m`duplicates`\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2756 ' Allow duplicate values to be offered for completion. '
2757 'Defaults to '
2758 '\x1b[33m`false`\x1b[39;49;00m.\x1b[37m\x1b[39;49;00m\n',
2759 'notes': [],
2760 'output': '~ > example --value-list-1=<TAB>\n'
2761 'exec noexec\n'
2762 '\n'
2763 '~ > example --value-list-1=exec,<TAB>\n'
2764 'noexec\n'
2765 '\n'
2766 '~ > example --value-list-2=<TAB>\n'
2767 'one -- Description 1\n'
2768 'two -- Description 2\n',
2769 'short': 'Complete comma-separated lists of values'},
2770 {'also': {'environment': 'For completing environment variable names'},
2771 'category': 'basic',
2772 'command': 'variable',
2773 'definition': "prog: 'example'\n"
2774 'options:\n'
2775 " - option_strings: ['--variable']\n"
2776 " complete: ['variable']\n",
2777 'definition_colored': '\x1b[94mprog\x1b[39;49;00m:\x1b[37m '
2778 "\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[33mexample\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m\x1b[37m\x1b[39;49;00m\n"
2779 '\x1b[94moptions\x1b[39;49;00m:\x1b[37m\x1b[39;49;00m\n'
2780 '\x1b[37m \x1b[39;49;00m-\x1b[37m '
2781 '\x1b[39;49;00m\x1b[94moption_strings\x1b[39;49;00m:\x1b[37m '
2782 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33m--variable\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n"
2783 '\x1b[37m '
2784 '\x1b[39;49;00m\x1b[94mcomplete\x1b[39;49;00m:\x1b[37m '
2785 "\x1b[39;49;00m[\x1b[33m'\x1b[39;49;00m\x1b[33mvariable\x1b[39;49;00m\x1b[33m'\x1b[39;49;00m]\x1b[37m\x1b[39;49;00m\n",
2786 'implemented': None,
2787 'long': None,
2788 'long_colored': None,
2789 'notes': [],
2790 'output': '~ > example --variable=HO<TAB>\nHOME HOSTNAME HOSTTYPE\n',
2791 'short': 'Complete shell variable names'}]
2792
2793
2794 class TerminalFormatter:
2795 '''Format string for terminals.'''
2796
2797 def __init__(self, use_colors, tab_width):
2798 self.use_colors = use_colors
2799 self.tab_width = tab_width
2800 self.tab = ' ' * tab_width
2801
2802 def bold(self, s):
2803 '''Make bold string.'''
2804
2805 if not self.use_colors:
2806 return s
2807
2808 return f"\033[1m{s}\033[0m"
2809
2810 def underline(self, s):
2811 '''Make underline string.'''
2812
2813 if not self.use_colors:
2814 return s
2815
2816 return f"\033[4m{s}\033[0m"
2817
2818
2819 def _make_command_section(command, formatter):
2820 r = formatter.bold('COMMAND')
2821 r += f'\n{formatter.tab}{command["command"]}'
2822 return r
2823
2824
2825 def _make_description_section(command, formatter):
2826 r = formatter.bold('DESCRIPTION')
2827 r += f'\n{formatter.tab}{command["short"]}'
2828
2829 if command['long']:
2830 r += '\n\n'
2831
2832 if formatter.use_colors:
2833 r += indent(command['long_colored'].strip(), formatter.tab_width)
2834 else:
2835 r += indent(command['long'].strip(), formatter.tab_width)
2836
2837 return r
2838
2839
2840 def _make_example_section(command, formatter):
2841 r = formatter.bold('EXAMPLE')
2842 r += '\n'
2843
2844 if formatter.use_colors:
2845 r += indent(command['definition_colored'].strip(), formatter.tab_width)
2846 else:
2847 r += indent(command['definition'].strip(), formatter.tab_width)
2848
2849 return r
2850
2851
2852 def _make_output_section(command, formatter):
2853 r = formatter.bold('OUTPUT')
2854 r += '\n'
2855 r += indent(command['output'].strip(), formatter.tab_width)
2856 return r
2857
2858
2859 def _make_notes_sectiong(notes, formatter):
2860 if not notes:
2861 return ''
2862
2863 r = [formatter.bold('NOTES')]
2864
2865 for note in notes:
2866 note = f'{formatter.tab}- {note}'
2867 r.append(note)
2868
2869 return '\n'.join(r)
2870
2871
2872 def _make_see_also_section(command, formatter):
2873 if not command['also']:
2874 return ''
2875
2876 r = formatter.bold('SEE ALSO')
2877 r += '\n'
2878
2879 for also_cmd, also_desc in command['also'].items():
2880 r += f'{formatter.tab}{formatter.bold(also_cmd)}: {also_desc}\n'
2881
2882 return r.rstrip()
2883
2884
2885 def print_help_for_command(name, use_colors):
2886 '''Print a manual like help for command `name`.'''
2887
2888 command = None
2889 for cmd in COMMANDS:
2890 if cmd['command'] == name:
2891 command = cmd
2892 break
2893
2894 if not command:
2895 raise CrazyError("Command not found: %s" % name)
2896
2897 formatter = TerminalFormatter(use_colors, 4)
2898
2899 notes = list(command['notes'])
2900 if command['implemented']:
2901 r = 'This completer is currently only implemented in '
2902 r += command['implemented'][0]
2903 if len(command['implemented']) > 1:
2904 r += ' and '
2905 r += command['implemented'][1]
2906 notes.append(r)
2907
2908 r = [
2909 _make_command_section(command, formatter),
2910 _make_description_section(command, formatter),
2911 _make_example_section(command, formatter),
2912 _make_output_section(command, formatter),
2913 _make_notes_sectiong(notes, formatter),
2914 _make_see_also_section(command, formatter),
2915 ]
2916
2917 print()
2918 print('\n\n'.join(l for l in r if l))
2919 print()
2920
2921
2922 def print_help_topic(topic, use_colors):
2923 '''Print help for `topic`.'''
2924
2925 try:
2926 print_help_for_command(topic, use_colors)
2927 except CrazyError:
2928 commands = [cmd['command'] for cmd in COMMANDS]
2929 print('Topic not found')
2930 print('')
2931 print('Available completers:')
2932 print(indent(join_with_wrap(' ', '\n', 40, commands), 4))