code: def gen_enum_completions(self, arg_name):
          
          try:  # if enum completion
              for choice in self.cmdtab[self.current_command].arguments[arg_name].choices:
                  if self.validate_completion(choice):
                      yield Completion(choice, -len(self.unfinished_word))
  
          except TypeError:  # there is no choices option
              pass
docs: generates dynamic enumeration completions