import click


def valid_shot_slice_point(slice_time, slice_index, points) -> bool:
    """Ensure that an valid combination of slice time and/or slice index has been provided.
    """
    if (slice_time is None) and (slice_index is None):
        click.echo("Either a slice time or slice index is required. See the '--slice-time' or '--slice-index' options.", err=True)
        return False
    if (slice_time is not None) and (slice_index is not None):
        click.echo("Specify slice index or time, but not both", err=True)
        return False
    if (slice_index is not None) and ((slice_index < 0) or (slice_index >= (points - 1))):
        click.echo("Slice index out of range.")
        return False
    return True