Revision 4e4b6b7a autotools/build-bash-completion
b/autotools/build-bash-completion | ||
---|---|---|
135 | 135 |
sw.DecIndent() |
136 | 136 |
sw.Write("}") |
137 | 137 |
|
138 |
sw.Write("_ganeti_network() {") |
|
139 |
sw.IncIndent() |
|
140 |
try: |
|
141 |
networks_path = os.path.join(pathutils.DATA_DIR, "ssconf_networks") |
|
142 |
sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(networks_path)) |
|
143 |
finally: |
|
144 |
sw.DecIndent() |
|
145 |
sw.Write("}") |
|
146 |
|
|
138 | 147 |
# Params: <offset> <options with values> <options without values> |
139 | 148 |
# Result variable: $first_arg_idx |
140 | 149 |
sw.Write("_ganeti_find_first_arg() {") |
... | ... | |
352 | 361 |
WriteCompReply(sw, "-W \"$(_ganeti_iallocator)\"", cur=cur) |
353 | 362 |
elif suggest == cli.OPT_COMPL_ONE_NODEGROUP: |
354 | 363 |
WriteCompReply(sw, "-W \"$(_ganeti_nodegroup)\"", cur=cur) |
364 |
elif suggest == cli.OPT_COMPL_ONE_NETWORK: |
|
365 |
WriteCompReply(sw, "-W \"$(_ganeti_network)\"", cur=cur) |
|
355 | 366 |
elif suggest == cli.OPT_COMPL_INST_ADD_NODES: |
356 | 367 |
sw.Write("local tmp= node1= pfx= curvalue=\"${optcur#*:}\"") |
357 | 368 |
|
... | ... | |
450 | 461 |
choices = "$(_ganeti_nodes)" |
451 | 462 |
elif isinstance(arg, cli.ArgGroup): |
452 | 463 |
choices = "$(_ganeti_nodegroup)" |
464 |
elif isinstance(arg, cli.ArgNetwork): |
|
465 |
choices = "$(_ganeti_network)" |
|
453 | 466 |
elif isinstance(arg, cli.ArgJobId): |
454 | 467 |
choices = "$(_ganeti_jobs)" |
455 | 468 |
elif isinstance(arg, cli.ArgOs): |
Also available in: Unified diff