def flagger(value):
    """
    Conversion routine for flags.  Accepts ints or comma-separated
    strings.

    :param str value: The value to convert.

    :returns: A value of an appropriate type.
    """

    try:
        # Convert as an integer
        return int(value)
    except ValueError:
        # Convert as a comma-separated list
        return [v.strip() for v in value.split(',')]