'generates dynamic enumeration completions'

def gen_enum_completions(self, arg_name, text, started_param, prefix):

    try:
        for choice in self.cmdtab[self.curr_command].arguments[arg_name].choices:
            if started_param:
                if (choice.lower().startswith(prefix.lower()) and (choice not in text.split())):
                    (yield Completion(choice, (- len(prefix))))
            else:
                (yield Completion(choice, (- len(prefix))))
    except TypeError:
        pass
