Skip to content
Snippets Groups Projects
Commit 30d44392 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Bash completion: Add function to get all iallocators


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarOlivier Tharan <olive@google.com>
parent d4b94fe8
No related branches found
No related tags found
No related merge requests found
...@@ -112,16 +112,20 @@ def WritePreamble(sw): ...@@ -112,16 +112,20 @@ def WritePreamble(sw):
sw.DecIndent() sw.DecIndent()
sw.Write("}") sw.Write("}")
sw.Write("_ganeti_os() {") for (fnname, paths) in [
sw.IncIndent() ("os", constants.OS_SEARCH_PATH),
try: ("iallocator", constants.IALLOCATOR_SEARCH_PATH),
# FIXME: Make querying the master for all OSes cheap ]:
for path in constants.OS_SEARCH_PATH: sw.Write("_ganeti_%s() {", fnname)
sw.Write("( shopt -s nullglob && cd %s 2>/dev/null && echo * || : )", sw.IncIndent()
utils.ShellQuote(path)) try:
finally: # FIXME: Make querying the master for all OSes cheap
sw.DecIndent() for path in paths:
sw.Write("}") sw.Write("( shopt -s nullglob && cd %s 2>/dev/null && echo * || : )",
utils.ShellQuote(path))
finally:
sw.DecIndent()
sw.Write("}")
# Params: <offset> <options with values> <options without values> # Params: <offset> <options with values> <options without values>
# Result variable: $first_arg_idx # Result variable: $first_arg_idx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment