<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cmdline(argv, flags):
 """A cmdopts wrapper that takes a list of flags and builds the corresponding cmdopts rules to match those flags."""

    rules = dict([(flag, {'flags': ["--%s" % flag]}) for flag in flags])
    return parse(argv, rules)