def parse_cores(core_str):
    """Parse core list passed through command line"""
    cores = []

    # remove spaces
    core_str.replace(" ", "")

    # check if not a range
    if '-' not in core_str:
        return list(map(int, core_str.strip().split(',')))

    # parse range e.g. 2-8
    core_str = core_str.strip().split('-')
    for i in range(int(core_str[0]), int(core_str[1]) + 1):
        cores.append(i)

    return cores