import multiprocessing
import click


def check_jobs(jobs):
    """Validate number of jobs."""
    if jobs == 0:
        raise click.UsageError("Jobs must be >= 1 or == -1")
    elif jobs < 0:

        jobs = multiprocessing.cpu_count()
    return jobs