code: def complete_rules(rules, cmd):
      '''complete using a list of completion rules'''
      if not isinstance(rules, list):
          rules = [rules]
      ret = []
      for r in rules:
          ret += complete_rule(r, cmd)
      return ref complete_rules(rules, cmd):
      '''complete using a list of completion rules'''
      if not isinstance(rules, list):
          rules = [rules]
      ret = []
      for r in rules:
          ret += complete_rule(r, cmd)
      return ret
docs: complete using a list of completion rules