Revision 63d44c55 lib/cli.py
b/lib/cli.py | ||
---|---|---|
56 | 56 |
"ArgInstance", "ArgNode", "ArgChoice", "ArgHost", |
57 | 57 |
"ARGS_NONE", "ARGS_ONE_INSTANCE", "ARGS_ONE_NODE", |
58 | 58 |
"ARGS_MANY_INSTANCES", "ARGS_MANY_NODES", |
59 |
"OPT_COMPL_ONE_NODE", "OPT_COMPL_ONE_INSTANCE", |
|
60 |
"OPT_COMPL_MANY_NODES", |
|
61 |
"OPT_COMPL_ONE_OS", "OPT_COMPL_ONE_IALLOCATOR", |
|
59 | 62 |
] |
60 | 63 |
|
61 | 64 |
NO_PREFIX = "no_" |
... | ... | |
330 | 333 |
return _SplitKeyVal(opt, value) |
331 | 334 |
|
332 | 335 |
|
336 |
# completion_suggestion is normally a list. Using numeric values not evaluating |
|
337 |
# to False for dynamic completion. |
|
338 |
(OPT_COMPL_MANY_NODES, |
|
339 |
OPT_COMPL_ONE_NODE, |
|
340 |
OPT_COMPL_ONE_INSTANCE, |
|
341 |
OPT_COMPL_ONE_OS, |
|
342 |
OPT_COMPL_ONE_IALLOCATOR) = range(100, 105) |
|
343 |
|
|
344 |
OPT_COMPL_ALL = frozenset([ |
|
345 |
OPT_COMPL_MANY_NODES, |
|
346 |
OPT_COMPL_ONE_NODE, |
|
347 |
OPT_COMPL_ONE_INSTANCE, |
|
348 |
OPT_COMPL_ONE_OS, |
|
349 |
OPT_COMPL_ONE_IALLOCATOR, |
|
350 |
]) |
|
351 |
|
|
352 |
|
|
333 | 353 |
class CliOption(Option): |
334 | 354 |
"""Custom option class for optparse. |
335 | 355 |
|
Also available in: Unified diff