Update the bash completion script
License: MIT Signed-off-by: Michael Muré <batolettre@gmail.com>
Michael Muré committed
Jul 18, 2015 at 14:43 UTC
557d5f211d5ab3a624c386722bfa0577439db616
1 file changed
+118
-42
misc/completion/ipfs-completion.bash
+118
-42
@@ -10,8 +10,23 @@ _ipfs_help_only()
10
11
_ipfs_add()
12
{
13
- _ipfs_comp "-recursive -quiet -progress -wrap-with-directory \
14
- -trickle --help"
13
+ _ipfs_comp "--recursive --quiet --progress --trickle --only-hash
14
+ --wrap-with-directory --hidden --help"
15
+}
16
+
17
+_ipfs_bitswap()
18
+{
19
+ ipfs_comp "stat wantlist --help"
20
+}
21
+
22
+_ipfs_bitswap_stat()
23
+{
24
+ _ipfs_help_only
25
+}
26
+
27
+_ipfs_bitswap_wantlist()
28
+{
29
+ ipfs_comp "--peer= --help"
30
}
31
32
_ipfs_block()
@@ -41,7 +56,7 @@ _ipfs_bootstrap()
56
57
_ipfs_bootstrap_add()
58
{
44
- _ipfs_comp "-default --help"
59
+ _ipfs_comp "--default --help"
60
}
61
62
_ipfs_bootstrap_list()
@@ -51,7 +66,7 @@ _ipfs_bootstrap_list()
66
67
_ipfs_bootstrap_rm()
68
{
54
- _ipfs_comp "-all --help"
69
+ _ipfs_comp "--all --help"
70
}
71
72
_ipfs_cat()
@@ -67,7 +82,7 @@ _ipfs_commands()
82
_ipfs_config()
83
{
84
# TODO: auto-complete existing config keys
70
- _ipfs_comp "edit replace show -bool --help"
85
+ _ipfs_comp "edit replace show --bool --json --help"
86
}
87
88
_ipfs_config_edit()
@@ -88,13 +103,14 @@ _ipfs_config_show()
103
104
_ipfs_daemon()
105
{
91
- _ipfs_comp "-init -routing= -mount -writable -mount-ipfs= \
92
- -mount-ipns= --help"
106
+ _ipfs_comp "--init --routing= --mount --writable --mount-ipfs= \
107
+ --mount-ipns= --unrestricted-api --disable-transport-encryption \
108
+ --help"
109
}
110
111
_ipfs_dht()
112
{
97
- _ipfs_comp "findpeer findprovs query --help"
113
+ _ipfs_comp "findpeer findprovs get put query --help"
114
}
115
116
_ipfs_dht_findpeer()
@@ -104,12 +120,22 @@ _ipfs_dht_findpeer()
120
121
_ipfs_dht_findprovs()
122
{
107
- _ipfs_comp "-verbose --help"
123
+ _ipfs_comp "--verbose --help"
124
+}
125
+
126
+_ipfs_dht_get()
127
+{
128
+ _ipfs_comp "--verbose --help"
129
+}
130
+
131
+_ipfs_dht_put()
132
+{
133
+ _ipfs_comp "--verbose --help"
134
}
135
136
_ipfs_dht_query()
137
{
112
- _ipfs_comp "-verbose --help"
138
+ _ipfs_comp "--verbose --help"
139
}
140
141
_ipfs_diag()
@@ -120,22 +146,37 @@ _ipfs_diag()
146
_ipfs_diag_net()
147
{
148
# TODO: auto-complete -vis=*
123
- _ipfs_comp "-timeout= -vis= --help"
149
+ _ipfs_comp "--timeout= --vis= --help"
150
+}
151
+
152
+_ipfs_dns()
153
+{
154
+ _ipfs_comp "--recursive --help"
155
+}
156
+
157
+_ipfs_file()
158
+{
159
+ _ipfs_comp "ls --help"
160
+}
161
+
162
+_ipfs_file_ls()
163
+{
164
+ _ipfs_help_only
165
}
166
167
_ipfs_get()
168
{
128
- _ipfs_comp "-output= -archive -compress -compression-level= --help"
169
+ _ipfs_comp "--output= --archive --compress --compression-level= --help"
170
}
171
172
_ipfs_id()
173
{
133
- _ipfs_comp "-format= --help"
174
+ _ipfs_comp "--format= --help"
175
}
176
177
_ipfs_init()
178
{
138
- _ipfs_comp "-bits= -passphrase= -force --help"
179
+ _ipfs_comp "--bits= --force --help"
180
}
181
182
_ipfs_log()
@@ -151,12 +192,12 @@ _ipfs_log_level()
192
193
_ipfs_log_tail()
194
{
154
- _ipfs_comp "tail level --help"
195
+ _ipfs_help_only
196
}
197
198
_ipfs_ls()
199
{
159
- _ipfs_help_only
200
+ _ipfs_comp "--headers --help"
201
}
202
203
_ipfs_mount()
@@ -176,12 +217,12 @@ _ipfs_name_publish()
217
218
_ipfs_name_resolve()
219
{
179
- _ipfs_help_only
220
+ _ipfs_comp "--recursive --help"
221
}
222
223
_ipfs_object()
224
{
184
- _ipfs_comp "data get links put stat --help"
225
+ _ipfs_comp "data get links new patch put stat --help"
226
}
227
228
_ipfs_object_data()
@@ -192,7 +233,7 @@ _ipfs_object_data()
233
_ipfs_object_get()
234
{
235
# TODO: auto-complete encoding
195
- _ipfs_comp "--encoding="
236
+ _ipfs_comp "--encoding= --help"
237
}
238
239
_ipfs_object_links()
@@ -200,11 +241,21 @@ _ipfs_object_links()
241
_ipfs_help_only
242
}
243
203
-_ipfs_object_put()
244
+_ipfs_object_new()
245
+{
246
+ _ipfs_help_only
247
+}
248
+
249
+_ipfs_object_patch()
250
{
251
_ipfs_help_only
252
}
253
254
+_ipfs_object_put()
255
+{
256
+ _ipfs_comp "--inputenc= --help"
257
+}
258
+
259
_ipfs_object_stat()
260
{
261
_ipfs_help_only
@@ -217,28 +268,28 @@ _ipfs_pin()
268
269
_ipfs_pin_add()
270
{
220
- _ipfs_comp "-recursive --help"
271
+ _ipfs_comp "--recursive --help"
272
}
273
274
_ipfs_pin_ls()
275
{
276
# TODO: auto-complete -type=*
226
- _ipfs_comp "-type= --help"
277
+ _ipfs_comp "--count --quiet --type= --help"
278
}
279
280
_ipfs_pin_rm()
281
{
231
- _ipfs_comp "-recursive --help"
282
+ _ipfs_comp "--recursive --help"
283
}
284
285
_ipfs_ping()
286
{
236
- _ipfs_comp "-count= --help"
287
+ _ipfs_comp "--count= --help"
288
}
289
290
_ipfs_refs()
291
{
241
- _ipfs_comp "local -format= -edges -unique -recursive --help"
292
+ _ipfs_comp "local --format= --edges --unique --recursive --help"
293
}
294
295
_ipfs_refs_local()
@@ -253,17 +304,37 @@ _ipfs_repo()
304
305
_ipfs_repo_gc()
306
{
256
- _ipfs_comp "-quiet --help"
307
+ _ipfs_comp "--quiet --help"
308
+}
309
+
310
+_ipfs_resolve()
311
+{
312
+ _ipfs_comp "--recursive --help"
313
+}
314
+
315
+_ipfs_stats()
316
+{
317
+ _ipfs_comp "bw --help"
318
+}
319
+
320
+_ipfs_stats_bw()
321
+{
322
+ _ipfs_comp "--peer= --proto= --poll --interval= --help"
323
}
324
325
_ipfs_swarm()
326
{
261
- _ipfs_comp "addrs connect disconnect peers --help"
327
+ _ipfs_comp "addrs connect disconnect filters peers --help"
328
}
329
330
_ipfs_swarm_addrs()
331
{
266
- _ipfs_help_only
332
+ _ipfs_comp "local --help"
333
+}
334
+
335
+_ipfs_swarm_addrs_local()
336
+{
337
+ _ipfs_comp "--id --help"
338
}
339
340
_ipfs_swarm_connect()
@@ -276,6 +347,21 @@ _ipfs_swarm_disconnect()
347
_ipfs_help_only
348
}
349
350
+_ipfs_swarm_filters()
351
+{
352
+ _ipfs_comp "add rm --help"
353
+}
354
+
355
+_ipfs_swarm_filters_add()
356
+{
357
+ _ipfs_help_only
358
+}
359
+
360
+_ipfs_swarm_filters_rm()
361
+{
362
+ _ipfs_help_only
363
+}
364
+
365
_ipfs_swarm_peers()
366
{
367
_ipfs_help_only
@@ -302,23 +388,13 @@ _ipfs_tour_restart()
388
}
389
390
_ipfs_update()
305
-{
306
- _ipfs_comp "check log --help"
307
-}
308
-
309
-_ipfs_update_check()
310
-{
311
- _ipfs_help_only
312
-}
313
-
314
-_ipfs_update_log()
391
{
392
_ipfs_help_only
393
}
394
395
_ipfs_version()
396
{
321
- _ipfs_comp "-number --help"
397
+ _ipfs_comp "--number --help"
398
}
399
400
_ipfs()
@@ -328,9 +404,9 @@ _ipfs()
404
405
case "${COMP_CWORD}" in
406
1)
331
- local opts="add block bootstrap cat commands config daemon dht diag get id \
332
- init log ls mount name object pin ping refs repo swarm tour \
333
- update version"
407
+ local opts="add bitswap block bootstrap cat commands config daemon dht \
408
+ diag dns file get id init log ls mount name object pin ping \
409
+ refs repo swarm tour update version"
410
COMPREPLY=( $(compgen -W "${opts}" -- ${word}) );;
411
2)
412
local command="${COMP_WORDS[1]}"