etna 0.1.13 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/bin/etna +18 -0
  3. data/etna.completion +926 -0
  4. data/etna_app.completion +133 -0
  5. data/ext/completions/extconf.rb +20 -0
  6. data/lib/commands.rb +360 -0
  7. data/lib/etna.rb +6 -0
  8. data/lib/etna/application.rb +46 -22
  9. data/lib/etna/client.rb +82 -48
  10. data/lib/etna/clients.rb +4 -0
  11. data/lib/etna/clients/enum.rb +9 -0
  12. data/lib/etna/clients/janus.rb +2 -0
  13. data/lib/etna/clients/janus/client.rb +73 -0
  14. data/lib/etna/clients/janus/models.rb +78 -0
  15. data/lib/etna/clients/magma.rb +4 -0
  16. data/lib/etna/clients/magma/client.rb +80 -0
  17. data/lib/etna/clients/magma/formatting.rb +1 -0
  18. data/lib/etna/clients/magma/formatting/models_csv.rb +345 -0
  19. data/lib/etna/clients/magma/models.rb +579 -0
  20. data/lib/etna/clients/magma/workflows.rb +10 -0
  21. data/lib/etna/clients/magma/workflows/add_project_models_workflow.rb +78 -0
  22. data/lib/etna/clients/magma/workflows/attribute_actions_from_json_workflow.rb +62 -0
  23. data/lib/etna/clients/magma/workflows/create_project_workflow.rb +117 -0
  24. data/lib/etna/clients/magma/workflows/crud_workflow.rb +85 -0
  25. data/lib/etna/clients/magma/workflows/ensure_containing_record_workflow.rb +44 -0
  26. data/lib/etna/clients/magma/workflows/file_attributes_blank_workflow.rb +68 -0
  27. data/lib/etna/clients/magma/workflows/file_linking_workflow.rb +115 -0
  28. data/lib/etna/clients/magma/workflows/json_converters.rb +81 -0
  29. data/lib/etna/clients/magma/workflows/json_validators.rb +447 -0
  30. data/lib/etna/clients/magma/workflows/model_synchronization_workflow.rb +306 -0
  31. data/lib/etna/clients/magma/workflows/record_synchronization_workflow.rb +63 -0
  32. data/lib/etna/clients/magma/workflows/update_attributes_from_csv_workflow.rb +178 -0
  33. data/lib/etna/clients/metis.rb +3 -0
  34. data/lib/etna/clients/metis/client.rb +239 -0
  35. data/lib/etna/clients/metis/models.rb +313 -0
  36. data/lib/etna/clients/metis/workflows.rb +2 -0
  37. data/lib/etna/clients/metis/workflows/metis_download_workflow.rb +37 -0
  38. data/lib/etna/clients/metis/workflows/metis_upload_workflow.rb +137 -0
  39. data/lib/etna/clients/polyphemus.rb +3 -0
  40. data/lib/etna/clients/polyphemus/client.rb +33 -0
  41. data/lib/etna/clients/polyphemus/models.rb +68 -0
  42. data/lib/etna/clients/polyphemus/workflows.rb +1 -0
  43. data/lib/etna/clients/polyphemus/workflows/set_configuration_workflow.rb +47 -0
  44. data/lib/etna/command.rb +243 -5
  45. data/lib/etna/controller.rb +4 -0
  46. data/lib/etna/directed_graph.rb +56 -0
  47. data/lib/etna/environment_scoped.rb +19 -0
  48. data/lib/etna/generate_autocompletion_script.rb +131 -0
  49. data/lib/etna/hmac.rb +1 -0
  50. data/lib/etna/json_serializable_struct.rb +37 -0
  51. data/lib/etna/logger.rb +15 -1
  52. data/lib/etna/multipart_serializable_nested_hash.rb +50 -0
  53. data/lib/etna/parse_body.rb +1 -1
  54. data/lib/etna/route.rb +1 -1
  55. data/lib/etna/server.rb +3 -0
  56. data/lib/etna/spec/vcr.rb +98 -0
  57. data/lib/etna/templates/attribute_actions_template.json +43 -0
  58. data/lib/etna/test_auth.rb +4 -2
  59. data/lib/etna/user.rb +11 -1
  60. data/lib/helpers.rb +87 -0
  61. metadata +69 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1957f3a561e396ebc9ad8882a6116142897188e504f9c71057efc4fd28b30cf3
4
- data.tar.gz: 143a547e83b9f626df1c9ad72b5995bd10cc8942dd68e6580c8f447347632761
3
+ metadata.gz: 4e4db6a6c798917fe8a1e96d7f02a2d604d259d3e2da08f083899655b2638b55
4
+ data.tar.gz: 989a69710cad57444da6ac526fc4728e706e0b4c891b720a8307b8207949453d
5
5
  SHA512:
6
- metadata.gz: 002203c0dd9098c8b106ee8d63e8a7a820fc1cf6732f38610eb39d1570c69cf7cf5d36c0f7d525a0aa5e4ff103ec2ce7f86d23e8dce3b6526a757572d936944c
7
- data.tar.gz: 2a902890d9839b46b0473208b9e2a17d214754f264abb0b0268ee81ab0fd473b50393b1aba2a51b3e93c27c6de98b29bd130ef4dae014baaa626b80151ae1cf9
6
+ metadata.gz: bb98337dd93af44ae0bda211a413178f25ba6ad08b39c34dde855d6288ee291f26b8c629b67f24e2be56667405a93662308dca804fcf2b70aefbd41da3c8ea13
7
+ data.tar.gz: aed1a1f77965ef30eb67bffe021547fb92ad03b836dcd940bd98c55020309bee568981f058e5365580d29462f03dd41efb645c3b3f5575682d06e9af927e51a1
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if ENV['ETNA_GEM_DEVELOPMENT']
4
+ require 'bundler'
5
+ Bundler.require :default
6
+ end
7
+
8
+ require 'yaml'
9
+ require_relative '../lib/etna'
10
+ require_relative '../lib/commands'
11
+
12
+ config = if File.exists?(EtnaApp.config_file_path)
13
+ YAML.load(File.read(EtnaApp.config_file_path))
14
+ else
15
+ {}
16
+ end
17
+
18
+ EtnaApp.instance.run_command(config, *ARGV)
@@ -0,0 +1,926 @@
1
+ #!/usr/bin/env bash
2
+
3
+ function _etna_completions() {
4
+ _etna_inner_completions "${COMP_WORDS[@]:1:COMP_CWORD}"
5
+ }
6
+
7
+ function _etna_inner_completions() {
8
+ local all_flag_completion_names=''
9
+ local string_flag_completion_names=''
10
+ local all_completion_names=''
11
+ local i=''
12
+ local a=''
13
+
14
+ all_flag_completion_names="$all_flag_completion_names --environment "
15
+ string_flag_completion_names="$string_flag_completion_names --environment "
16
+ declare _completions_for_environment="production staging development"
17
+ while [[ "$#" != "0" ]]; do
18
+ if [[ "$#" == "1" ]]; then
19
+ all_completion_names="administrate config console create_template generate_completion_script help polyphemus"
20
+ all_completion_names="$all_completion_names $all_flag_completion_names"
21
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
22
+ return
23
+ fi
24
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
25
+ return
26
+ elif [[ "$1" == "administrate" ]]; then
27
+ shift
28
+ all_flag_completion_names="$all_flag_completion_names "
29
+ string_flag_completion_names="$string_flag_completion_names "
30
+ while [[ "$#" != "0" ]]; do
31
+ if [[ "$#" == "1" ]]; then
32
+ all_completion_names="help models project"
33
+ all_completion_names="$all_completion_names $all_flag_completion_names"
34
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
35
+ return
36
+ fi
37
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
38
+ return
39
+ elif [[ "$1" == "help" ]]; then
40
+ shift
41
+ all_flag_completion_names="$all_flag_completion_names "
42
+ string_flag_completion_names="$string_flag_completion_names "
43
+ while [[ "$#" != "0" ]]; do
44
+ if [[ "$#" == "1" ]]; then
45
+ all_completion_names=""
46
+ all_completion_names="$all_completion_names $all_flag_completion_names"
47
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
48
+ return
49
+ fi
50
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
51
+ return
52
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
53
+ return
54
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
55
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
56
+ a=$1
57
+ shift
58
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
59
+ if [[ "$#" == "1" ]]; then
60
+ a="${a//--/}"
61
+ a="${a//-/_}"
62
+ i="_completions_for_$a"
63
+ all_completion_names="${!i}"
64
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
65
+ return
66
+ fi
67
+ shift
68
+ fi
69
+ else
70
+ return
71
+ fi
72
+ done
73
+ return
74
+ elif [[ "$1" == "models" ]]; then
75
+ shift
76
+ all_flag_completion_names="$all_flag_completion_names "
77
+ string_flag_completion_names="$string_flag_completion_names "
78
+ while [[ "$#" != "0" ]]; do
79
+ if [[ "$#" == "1" ]]; then
80
+ all_completion_names="apply_template attributes copy_template help"
81
+ all_completion_names="$all_completion_names $all_flag_completion_names"
82
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
83
+ return
84
+ fi
85
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
86
+ return
87
+ elif [[ "$1" == "apply_template" ]]; then
88
+ shift
89
+ if [[ "$#" == "1" ]]; then
90
+ all_completion_names="__project_name__"
91
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
92
+ return
93
+ fi
94
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
95
+ return
96
+ fi
97
+ shift
98
+ all_flag_completion_names="$all_flag_completion_names --file --target-model "
99
+ string_flag_completion_names="$string_flag_completion_names --file --target-model "
100
+ declare _completions_for_file="__file__"
101
+ declare _completions_for_target_model="__target_model__"
102
+ while [[ "$#" != "0" ]]; do
103
+ if [[ "$#" == "1" ]]; then
104
+ all_completion_names=""
105
+ all_completion_names="$all_completion_names $all_flag_completion_names"
106
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
107
+ return
108
+ fi
109
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
110
+ return
111
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
112
+ return
113
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
114
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
115
+ a=$1
116
+ shift
117
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
118
+ if [[ "$#" == "1" ]]; then
119
+ a="${a//--/}"
120
+ a="${a//-/_}"
121
+ i="_completions_for_$a"
122
+ all_completion_names="${!i}"
123
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
124
+ return
125
+ fi
126
+ shift
127
+ fi
128
+ else
129
+ return
130
+ fi
131
+ done
132
+ return
133
+ elif [[ "$1" == "attributes" ]]; then
134
+ shift
135
+ all_flag_completion_names="$all_flag_completion_names "
136
+ string_flag_completion_names="$string_flag_completion_names "
137
+ while [[ "$#" != "0" ]]; do
138
+ if [[ "$#" == "1" ]]; then
139
+ all_completion_names="help update_from_csv"
140
+ all_completion_names="$all_completion_names $all_flag_completion_names"
141
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
142
+ return
143
+ fi
144
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
145
+ return
146
+ elif [[ "$1" == "help" ]]; then
147
+ shift
148
+ all_flag_completion_names="$all_flag_completion_names "
149
+ string_flag_completion_names="$string_flag_completion_names "
150
+ while [[ "$#" != "0" ]]; do
151
+ if [[ "$#" == "1" ]]; then
152
+ all_completion_names=""
153
+ all_completion_names="$all_completion_names $all_flag_completion_names"
154
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
155
+ return
156
+ fi
157
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
158
+ return
159
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
160
+ return
161
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
162
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
163
+ a=$1
164
+ shift
165
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
166
+ if [[ "$#" == "1" ]]; then
167
+ a="${a//--/}"
168
+ a="${a//-/_}"
169
+ i="_completions_for_$a"
170
+ all_completion_names="${!i}"
171
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
172
+ return
173
+ fi
174
+ shift
175
+ fi
176
+ else
177
+ return
178
+ fi
179
+ done
180
+ return
181
+ elif [[ "$1" == "update_from_csv" ]]; then
182
+ shift
183
+ if [[ "$#" == "1" ]]; then
184
+ all_completion_names="__project_name__"
185
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
186
+ return
187
+ fi
188
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
189
+ return
190
+ fi
191
+ shift
192
+ if [[ "$#" == "1" ]]; then
193
+ all_completion_names="__model_name__"
194
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
195
+ return
196
+ fi
197
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
198
+ return
199
+ fi
200
+ shift
201
+ if [[ "$#" == "1" ]]; then
202
+ all_completion_names="__filepath__"
203
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
204
+ return
205
+ fi
206
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
207
+ return
208
+ fi
209
+ shift
210
+ all_flag_completion_names="$all_flag_completion_names "
211
+ string_flag_completion_names="$string_flag_completion_names "
212
+ while [[ "$#" != "0" ]]; do
213
+ if [[ "$#" == "1" ]]; then
214
+ all_completion_names=""
215
+ all_completion_names="$all_completion_names $all_flag_completion_names"
216
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
217
+ return
218
+ fi
219
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
220
+ return
221
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
222
+ return
223
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
224
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
225
+ a=$1
226
+ shift
227
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
228
+ if [[ "$#" == "1" ]]; then
229
+ a="${a//--/}"
230
+ a="${a//-/_}"
231
+ i="_completions_for_$a"
232
+ all_completion_names="${!i}"
233
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
234
+ return
235
+ fi
236
+ shift
237
+ fi
238
+ else
239
+ return
240
+ fi
241
+ done
242
+ return
243
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
244
+ return
245
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
246
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
247
+ a=$1
248
+ shift
249
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
250
+ if [[ "$#" == "1" ]]; then
251
+ a="${a//--/}"
252
+ a="${a//-/_}"
253
+ i="_completions_for_$a"
254
+ all_completion_names="${!i}"
255
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
256
+ return
257
+ fi
258
+ shift
259
+ fi
260
+ else
261
+ return
262
+ fi
263
+ done
264
+ elif [[ "$1" == "copy_template" ]]; then
265
+ shift
266
+ if [[ "$#" == "1" ]]; then
267
+ all_completion_names="__project_name__"
268
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
269
+ return
270
+ fi
271
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
272
+ return
273
+ fi
274
+ shift
275
+ all_flag_completion_names="$all_flag_completion_names --file --target-model "
276
+ string_flag_completion_names="$string_flag_completion_names --file --target-model "
277
+ declare _completions_for_file="__file__"
278
+ declare _completions_for_target_model="__target_model__"
279
+ while [[ "$#" != "0" ]]; do
280
+ if [[ "$#" == "1" ]]; then
281
+ all_completion_names=""
282
+ all_completion_names="$all_completion_names $all_flag_completion_names"
283
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
284
+ return
285
+ fi
286
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
287
+ return
288
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
289
+ return
290
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
291
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
292
+ a=$1
293
+ shift
294
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
295
+ if [[ "$#" == "1" ]]; then
296
+ a="${a//--/}"
297
+ a="${a//-/_}"
298
+ i="_completions_for_$a"
299
+ all_completion_names="${!i}"
300
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
301
+ return
302
+ fi
303
+ shift
304
+ fi
305
+ else
306
+ return
307
+ fi
308
+ done
309
+ return
310
+ elif [[ "$1" == "help" ]]; then
311
+ shift
312
+ all_flag_completion_names="$all_flag_completion_names "
313
+ string_flag_completion_names="$string_flag_completion_names "
314
+ while [[ "$#" != "0" ]]; do
315
+ if [[ "$#" == "1" ]]; then
316
+ all_completion_names=""
317
+ all_completion_names="$all_completion_names $all_flag_completion_names"
318
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
319
+ return
320
+ fi
321
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
322
+ return
323
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
324
+ return
325
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
326
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
327
+ a=$1
328
+ shift
329
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
330
+ if [[ "$#" == "1" ]]; then
331
+ a="${a//--/}"
332
+ a="${a//-/_}"
333
+ i="_completions_for_$a"
334
+ all_completion_names="${!i}"
335
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
336
+ return
337
+ fi
338
+ shift
339
+ fi
340
+ else
341
+ return
342
+ fi
343
+ done
344
+ return
345
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
346
+ return
347
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
348
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
349
+ a=$1
350
+ shift
351
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
352
+ if [[ "$#" == "1" ]]; then
353
+ a="${a//--/}"
354
+ a="${a//-/_}"
355
+ i="_completions_for_$a"
356
+ all_completion_names="${!i}"
357
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
358
+ return
359
+ fi
360
+ shift
361
+ fi
362
+ else
363
+ return
364
+ fi
365
+ done
366
+ elif [[ "$1" == "project" ]]; then
367
+ shift
368
+ all_flag_completion_names="$all_flag_completion_names "
369
+ string_flag_completion_names="$string_flag_completion_names "
370
+ while [[ "$#" != "0" ]]; do
371
+ if [[ "$#" == "1" ]]; then
372
+ all_completion_names="create help"
373
+ all_completion_names="$all_completion_names $all_flag_completion_names"
374
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
375
+ return
376
+ fi
377
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
378
+ return
379
+ elif [[ "$1" == "create" ]]; then
380
+ shift
381
+ if [[ "$#" == "1" ]]; then
382
+ all_completion_names="__project_name__"
383
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
384
+ return
385
+ fi
386
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
387
+ return
388
+ fi
389
+ shift
390
+ if [[ "$#" == "1" ]]; then
391
+ all_completion_names="__project_name_full__"
392
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
393
+ return
394
+ fi
395
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
396
+ return
397
+ fi
398
+ shift
399
+ all_flag_completion_names="$all_flag_completion_names "
400
+ string_flag_completion_names="$string_flag_completion_names "
401
+ while [[ "$#" != "0" ]]; do
402
+ if [[ "$#" == "1" ]]; then
403
+ all_completion_names=""
404
+ all_completion_names="$all_completion_names $all_flag_completion_names"
405
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
406
+ return
407
+ fi
408
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
409
+ return
410
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
411
+ return
412
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
413
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
414
+ a=$1
415
+ shift
416
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
417
+ if [[ "$#" == "1" ]]; then
418
+ a="${a//--/}"
419
+ a="${a//-/_}"
420
+ i="_completions_for_$a"
421
+ all_completion_names="${!i}"
422
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
423
+ return
424
+ fi
425
+ shift
426
+ fi
427
+ else
428
+ return
429
+ fi
430
+ done
431
+ return
432
+ elif [[ "$1" == "help" ]]; then
433
+ shift
434
+ all_flag_completion_names="$all_flag_completion_names "
435
+ string_flag_completion_names="$string_flag_completion_names "
436
+ while [[ "$#" != "0" ]]; do
437
+ if [[ "$#" == "1" ]]; then
438
+ all_completion_names=""
439
+ all_completion_names="$all_completion_names $all_flag_completion_names"
440
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
441
+ return
442
+ fi
443
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
444
+ return
445
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
446
+ return
447
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
448
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
449
+ a=$1
450
+ shift
451
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
452
+ if [[ "$#" == "1" ]]; then
453
+ a="${a//--/}"
454
+ a="${a//-/_}"
455
+ i="_completions_for_$a"
456
+ all_completion_names="${!i}"
457
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
458
+ return
459
+ fi
460
+ shift
461
+ fi
462
+ else
463
+ return
464
+ fi
465
+ done
466
+ return
467
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
468
+ return
469
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
470
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
471
+ a=$1
472
+ shift
473
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
474
+ if [[ "$#" == "1" ]]; then
475
+ a="${a//--/}"
476
+ a="${a//-/_}"
477
+ i="_completions_for_$a"
478
+ all_completion_names="${!i}"
479
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
480
+ return
481
+ fi
482
+ shift
483
+ fi
484
+ else
485
+ return
486
+ fi
487
+ done
488
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
489
+ return
490
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
491
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
492
+ a=$1
493
+ shift
494
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
495
+ if [[ "$#" == "1" ]]; then
496
+ a="${a//--/}"
497
+ a="${a//-/_}"
498
+ i="_completions_for_$a"
499
+ all_completion_names="${!i}"
500
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
501
+ return
502
+ fi
503
+ shift
504
+ fi
505
+ else
506
+ return
507
+ fi
508
+ done
509
+ elif [[ "$1" == "config" ]]; then
510
+ shift
511
+ all_flag_completion_names="$all_flag_completion_names "
512
+ string_flag_completion_names="$string_flag_completion_names "
513
+ while [[ "$#" != "0" ]]; do
514
+ if [[ "$#" == "1" ]]; then
515
+ all_completion_names="help set show"
516
+ all_completion_names="$all_completion_names $all_flag_completion_names"
517
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
518
+ return
519
+ fi
520
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
521
+ return
522
+ elif [[ "$1" == "help" ]]; then
523
+ shift
524
+ all_flag_completion_names="$all_flag_completion_names "
525
+ string_flag_completion_names="$string_flag_completion_names "
526
+ while [[ "$#" != "0" ]]; do
527
+ if [[ "$#" == "1" ]]; then
528
+ all_completion_names=""
529
+ all_completion_names="$all_completion_names $all_flag_completion_names"
530
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
531
+ return
532
+ fi
533
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
534
+ return
535
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
536
+ return
537
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
538
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
539
+ a=$1
540
+ shift
541
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
542
+ if [[ "$#" == "1" ]]; then
543
+ a="${a//--/}"
544
+ a="${a//-/_}"
545
+ i="_completions_for_$a"
546
+ all_completion_names="${!i}"
547
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
548
+ return
549
+ fi
550
+ shift
551
+ fi
552
+ else
553
+ return
554
+ fi
555
+ done
556
+ return
557
+ elif [[ "$1" == "set" ]]; then
558
+ shift
559
+ if [[ "$#" == "1" ]]; then
560
+ all_completion_names="__host__"
561
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
562
+ return
563
+ fi
564
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
565
+ return
566
+ fi
567
+ shift
568
+ all_flag_completion_names="$all_flag_completion_names --ignore-ssl "
569
+ string_flag_completion_names="$string_flag_completion_names "
570
+ while [[ "$#" != "0" ]]; do
571
+ if [[ "$#" == "1" ]]; then
572
+ all_completion_names=""
573
+ all_completion_names="$all_completion_names $all_flag_completion_names"
574
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
575
+ return
576
+ fi
577
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
578
+ return
579
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
580
+ return
581
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
582
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
583
+ a=$1
584
+ shift
585
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
586
+ if [[ "$#" == "1" ]]; then
587
+ a="${a//--/}"
588
+ a="${a//-/_}"
589
+ i="_completions_for_$a"
590
+ all_completion_names="${!i}"
591
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
592
+ return
593
+ fi
594
+ shift
595
+ fi
596
+ else
597
+ return
598
+ fi
599
+ done
600
+ return
601
+ elif [[ "$1" == "show" ]]; then
602
+ shift
603
+ all_flag_completion_names="$all_flag_completion_names "
604
+ string_flag_completion_names="$string_flag_completion_names "
605
+ while [[ "$#" != "0" ]]; do
606
+ if [[ "$#" == "1" ]]; then
607
+ all_completion_names=""
608
+ all_completion_names="$all_completion_names $all_flag_completion_names"
609
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
610
+ return
611
+ fi
612
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
613
+ return
614
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
615
+ return
616
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
617
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
618
+ a=$1
619
+ shift
620
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
621
+ if [[ "$#" == "1" ]]; then
622
+ a="${a//--/}"
623
+ a="${a//-/_}"
624
+ i="_completions_for_$a"
625
+ all_completion_names="${!i}"
626
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
627
+ return
628
+ fi
629
+ shift
630
+ fi
631
+ else
632
+ return
633
+ fi
634
+ done
635
+ return
636
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
637
+ return
638
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
639
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
640
+ a=$1
641
+ shift
642
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
643
+ if [[ "$#" == "1" ]]; then
644
+ a="${a//--/}"
645
+ a="${a//-/_}"
646
+ i="_completions_for_$a"
647
+ all_completion_names="${!i}"
648
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
649
+ return
650
+ fi
651
+ shift
652
+ fi
653
+ else
654
+ return
655
+ fi
656
+ done
657
+ elif [[ "$1" == "console" ]]; then
658
+ shift
659
+ all_flag_completion_names="$all_flag_completion_names "
660
+ string_flag_completion_names="$string_flag_completion_names "
661
+ while [[ "$#" != "0" ]]; do
662
+ if [[ "$#" == "1" ]]; then
663
+ all_completion_names=""
664
+ all_completion_names="$all_completion_names $all_flag_completion_names"
665
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
666
+ return
667
+ fi
668
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
669
+ return
670
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
671
+ return
672
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
673
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
674
+ a=$1
675
+ shift
676
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
677
+ if [[ "$#" == "1" ]]; then
678
+ a="${a//--/}"
679
+ a="${a//-/_}"
680
+ i="_completions_for_$a"
681
+ all_completion_names="${!i}"
682
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
683
+ return
684
+ fi
685
+ shift
686
+ fi
687
+ else
688
+ return
689
+ fi
690
+ done
691
+ return
692
+ elif [[ "$1" == "create_template" ]]; then
693
+ shift
694
+ all_flag_completion_names="$all_flag_completion_names "
695
+ string_flag_completion_names="$string_flag_completion_names "
696
+ while [[ "$#" != "0" ]]; do
697
+ if [[ "$#" == "1" ]]; then
698
+ all_completion_names="attribute_actions help"
699
+ all_completion_names="$all_completion_names $all_flag_completion_names"
700
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
701
+ return
702
+ fi
703
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
704
+ return
705
+ elif [[ "$1" == "attribute_actions" ]]; then
706
+ shift
707
+ all_flag_completion_names="$all_flag_completion_names "
708
+ string_flag_completion_names="$string_flag_completion_names "
709
+ while [[ "$#" != "0" ]]; do
710
+ if [[ "$#" == "1" ]]; then
711
+ all_completion_names=""
712
+ all_completion_names="$all_completion_names $all_flag_completion_names"
713
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
714
+ return
715
+ fi
716
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
717
+ return
718
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
719
+ return
720
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
721
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
722
+ a=$1
723
+ shift
724
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
725
+ if [[ "$#" == "1" ]]; then
726
+ a="${a//--/}"
727
+ a="${a//-/_}"
728
+ i="_completions_for_$a"
729
+ all_completion_names="${!i}"
730
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
731
+ return
732
+ fi
733
+ shift
734
+ fi
735
+ else
736
+ return
737
+ fi
738
+ done
739
+ return
740
+ elif [[ "$1" == "help" ]]; then
741
+ shift
742
+ all_flag_completion_names="$all_flag_completion_names "
743
+ string_flag_completion_names="$string_flag_completion_names "
744
+ while [[ "$#" != "0" ]]; do
745
+ if [[ "$#" == "1" ]]; then
746
+ all_completion_names=""
747
+ all_completion_names="$all_completion_names $all_flag_completion_names"
748
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
749
+ return
750
+ fi
751
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
752
+ return
753
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
754
+ return
755
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
756
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
757
+ a=$1
758
+ shift
759
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
760
+ if [[ "$#" == "1" ]]; then
761
+ a="${a//--/}"
762
+ a="${a//-/_}"
763
+ i="_completions_for_$a"
764
+ all_completion_names="${!i}"
765
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
766
+ return
767
+ fi
768
+ shift
769
+ fi
770
+ else
771
+ return
772
+ fi
773
+ done
774
+ return
775
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
776
+ return
777
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
778
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
779
+ a=$1
780
+ shift
781
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
782
+ if [[ "$#" == "1" ]]; then
783
+ a="${a//--/}"
784
+ a="${a//-/_}"
785
+ i="_completions_for_$a"
786
+ all_completion_names="${!i}"
787
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
788
+ return
789
+ fi
790
+ shift
791
+ fi
792
+ else
793
+ return
794
+ fi
795
+ done
796
+ elif [[ "$1" == "generate_completion_script" ]]; then
797
+ shift
798
+ all_flag_completion_names="$all_flag_completion_names "
799
+ string_flag_completion_names="$string_flag_completion_names "
800
+ while [[ "$#" != "0" ]]; do
801
+ if [[ "$#" == "1" ]]; then
802
+ all_completion_names=""
803
+ all_completion_names="$all_completion_names $all_flag_completion_names"
804
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
805
+ return
806
+ fi
807
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
808
+ return
809
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
810
+ return
811
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
812
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
813
+ a=$1
814
+ shift
815
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
816
+ if [[ "$#" == "1" ]]; then
817
+ a="${a//--/}"
818
+ a="${a//-/_}"
819
+ i="_completions_for_$a"
820
+ all_completion_names="${!i}"
821
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
822
+ return
823
+ fi
824
+ shift
825
+ fi
826
+ else
827
+ return
828
+ fi
829
+ done
830
+ return
831
+ elif [[ "$1" == "help" ]]; then
832
+ shift
833
+ all_flag_completion_names="$all_flag_completion_names "
834
+ string_flag_completion_names="$string_flag_completion_names "
835
+ while [[ "$#" != "0" ]]; do
836
+ if [[ "$#" == "1" ]]; then
837
+ all_completion_names=""
838
+ all_completion_names="$all_completion_names $all_flag_completion_names"
839
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
840
+ return
841
+ fi
842
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
843
+ return
844
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
845
+ return
846
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
847
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
848
+ a=$1
849
+ shift
850
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
851
+ if [[ "$#" == "1" ]]; then
852
+ a="${a//--/}"
853
+ a="${a//-/_}"
854
+ i="_completions_for_$a"
855
+ all_completion_names="${!i}"
856
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
857
+ return
858
+ fi
859
+ shift
860
+ fi
861
+ else
862
+ return
863
+ fi
864
+ done
865
+ return
866
+ elif [[ "$1" == "polyphemus" ]]; then
867
+ shift
868
+ all_flag_completion_names="$all_flag_completion_names --local --tag "
869
+ string_flag_completion_names="$string_flag_completion_names --tag "
870
+ declare _completions_for_tag="__tag__"
871
+ while [[ "$#" != "0" ]]; do
872
+ if [[ "$#" == "1" ]]; then
873
+ all_completion_names=""
874
+ all_completion_names="$all_completion_names $all_flag_completion_names"
875
+ if [[ -z "$(echo $all_completion_names | xargs)" ]]; then
876
+ return
877
+ fi
878
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
879
+ return
880
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
881
+ return
882
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
883
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
884
+ a=$1
885
+ shift
886
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
887
+ if [[ "$#" == "1" ]]; then
888
+ a="${a//--/}"
889
+ a="${a//-/_}"
890
+ i="_completions_for_$a"
891
+ all_completion_names="${!i}"
892
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
893
+ return
894
+ fi
895
+ shift
896
+ fi
897
+ else
898
+ return
899
+ fi
900
+ done
901
+ return
902
+ elif [[ -z "$(echo $all_flag_completion_names | xargs)" ]]; then
903
+ return
904
+ elif [[ "$all_flag_completion_names" =~ $1\ ]]; then
905
+ all_flag_completion_names="${all_flag_completion_names//$1\ /}"
906
+ a=$1
907
+ shift
908
+ if [[ "$string_flag_completion_names" =~ $a\ ]]; then
909
+ if [[ "$#" == "1" ]]; then
910
+ a="${a//--/}"
911
+ a="${a//-/_}"
912
+ i="_completions_for_$a"
913
+ all_completion_names="${!i}"
914
+ COMPREPLY=($(compgen -W "$all_completion_names" -- "$1"))
915
+ return
916
+ fi
917
+ shift
918
+ fi
919
+ else
920
+ return
921
+ fi
922
+ done
923
+ }
924
+
925
+ complete -o default -F _etna_completions etna
926
+