def zshopts():
    fmt = '"%s[%s]%s%s"'

    def getmetavar(action):
        if action.takes_value():
            return ':arg'
        else:
            return ''

    long_opts  = [(a._long_opts, getmetavar(a), a.help)  for a in options]
    short_opts = [(a._short_opts, getmetavar(a), a.help) for a in options]

    for op in (long_opts, short_opts):
        for o, m, h in op:
            yield (o[0], escape(h), m, '') % fmt
dataset/ETHPy150Open gvalkov/rsstail.py/compgen.py/zshopts/swapped operands of `%`