def take(option, args, *, mut=True):
    """Use an option object to take a range of arguments from a list."""
    try:
        start, end = option.span(args)
    except IndexError:
        return option.missing()
    taken = option.found(args[start:end])
    if mut:
        del args[start:end]
    return taken
