Revision 36e247e1
b/autotools/build-bash-completion | ||
---|---|---|
117 | 117 |
sw.DecIndent() |
118 | 118 |
sw.Write("}") |
119 | 119 |
|
120 |
sw.Write("_ganeti_nodegroup() {") |
|
121 |
sw.IncIndent() |
|
122 |
try: |
|
123 |
nodegroups_path = os.path.join(constants.DATA_DIR, "ssconf_nodegroups") |
|
124 |
sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(nodegroups_path)) |
|
125 |
finally: |
|
126 |
sw.DecIndent() |
|
127 |
sw.Write("}") |
|
128 |
|
|
120 | 129 |
# Params: <offset> <options with values> <options without values> |
121 | 130 |
# Result variable: $first_arg_idx |
122 | 131 |
sw.Write("_ganeti_find_first_arg() {") |
... | ... | |
324 | 333 |
WriteCompReply(sw, "-W \"$(_ganeti_os)\"", cur=cur) |
325 | 334 |
elif suggest == cli.OPT_COMPL_ONE_IALLOCATOR: |
326 | 335 |
WriteCompReply(sw, "-W \"$(_ganeti_iallocator)\"", cur=cur) |
336 |
elif suggest == cli.OPT_COMPL_ONE_NODEGROUP: |
|
337 |
WriteCompReply(sw, "-W \"$(_ganeti_nodegroup)\"", cur=cur) |
|
327 | 338 |
elif suggest == cli.OPT_COMPL_INST_ADD_NODES: |
328 | 339 |
sw.Write("local tmp= node1= pfx= curvalue=\"${optcur#*:}\"") |
329 | 340 |
|
b/lib/cli.py | ||
---|---|---|
194 | 194 |
"OPT_COMPL_ONE_IALLOCATOR", |
195 | 195 |
"OPT_COMPL_ONE_INSTANCE", |
196 | 196 |
"OPT_COMPL_ONE_NODE", |
197 |
"OPT_COMPL_ONE_NODEGROUP", |
|
197 | 198 |
"OPT_COMPL_ONE_OS", |
198 | 199 |
"cli_option", |
199 | 200 |
"SplitNodeOption", |
... | ... | |
515 | 516 |
OPT_COMPL_ONE_INSTANCE, |
516 | 517 |
OPT_COMPL_ONE_OS, |
517 | 518 |
OPT_COMPL_ONE_IALLOCATOR, |
518 |
OPT_COMPL_INST_ADD_NODES) = range(100, 106) |
|
519 |
OPT_COMPL_INST_ADD_NODES, |
|
520 |
OPT_COMPL_ONE_NODEGROUP) = range(100, 107) |
|
519 | 521 |
|
520 | 522 |
OPT_COMPL_ALL = frozenset([ |
521 | 523 |
OPT_COMPL_MANY_NODES, |
... | ... | |
524 | 526 |
OPT_COMPL_ONE_OS, |
525 | 527 |
OPT_COMPL_ONE_IALLOCATOR, |
526 | 528 |
OPT_COMPL_INST_ADD_NODES, |
529 |
OPT_COMPL_ONE_NODEGROUP, |
|
527 | 530 |
]) |
528 | 531 |
|
529 | 532 |
|
Also available in: Unified diff