def _dash_escape(args):
    """Escape all elements of *args* that need escaping.

    *args* may be any sequence and is not modified by this function.
    Return a new list where every element that needs escaping has been
    escaped.

    An element needs escaping when it starts with two ASCII hyphens
    (``--``). Escaping consists in prepending an element composed of two
    ASCII hyphens, i.e., the string ``'--'``.

    """
    res = []
    for arg in args:
        if arg.startswith('--'):
            res.extend(('--', arg))
        else:
            res.append(arg)
    return res
