Revision 30d44392

b/autotools/build-bash-completion
112 112
    sw.DecIndent()
113 113
  sw.Write("}")
114 114

  
115
  sw.Write("_ganeti_os() {")
116
  sw.IncIndent()
117
  try:
118
    # FIXME: Make querying the master for all OSes cheap
119
    for path in constants.OS_SEARCH_PATH:
120
      sw.Write("( shopt -s nullglob && cd %s 2>/dev/null && echo * || : )",
121
               utils.ShellQuote(path))
122
  finally:
123
    sw.DecIndent()
124
  sw.Write("}")
115
  for (fnname, paths) in [
116
      ("os", constants.OS_SEARCH_PATH),
117
      ("iallocator", constants.IALLOCATOR_SEARCH_PATH),
118
      ]:
119
    sw.Write("_ganeti_%s() {", fnname)
120
    sw.IncIndent()
121
    try:
122
      # FIXME: Make querying the master for all OSes cheap
123
      for path in paths:
124
        sw.Write("( shopt -s nullglob && cd %s 2>/dev/null && echo * || : )",
125
                 utils.ShellQuote(path))
126
    finally:
127
      sw.DecIndent()
128
    sw.Write("}")
125 129

  
126 130
  # Params: <offset> <options with values> <options without values>
127 131
  # Result variable: $first_arg_idx

Also available in: Unified diff