def groups_option(f):
    new_func = click.option("-g", "--groups",
                            help="Comma-separated list of requirement groups "
                            "to include.")(f)
    return update_wrapper(new_func, f)
def _patsplit(pattern, default):
    """Split a string into the optional pattern kind prefix and the actual
    pattern."""
    if ":" in pattern:
        kind, pat = pattern.split(":", 1)
        if kind in allpatternkinds:
            return kind, pat
    return default, pattern