def _mask(arg):
    """Convert the ``--mask`` argument.

    The string must be in the format ``key1=value1,key2=value2,...``,
    and is converted into a Python dict.
    """
    if not arg:
        return dict()
    return {k: int(v) for k, v in [spec.split('=') for spec in arg.split(',')]}