code: def foreach(self, argv, func):
          
          opts = cmdline(argv)
          if len(opts.args) == 0:
              error("Command requires an index name", 2)
          for name in opts.args:
              if name not in self.service.indexes:
                  error("Index '%s' does not exist" % name, 2)
              index = self.service.indexes[name]
              func(index)
docs: Apply the function to each index named in the argument vector.