def parse_scan_list_spec(scan_list_spec):
    """parses the argument of the -s option, returns a scan number list"""
    sl = scan_list_spec[0].split(',')
    scan_list = []
    for item in sl:
        sublist = item.split('-')
        if len(sublist) == 1:
            scan_list.append(int(sublist[0]))
        elif len(sublist) == 2:
            scan_list += range(int(sublist[0]), int(sublist[1]) + 1)
        else:
            raise ValueError('improper scan list specifier: ' + sublist)
    sl = []
    for item in sorted(scan_list):
        if item not in sl:
            sl.append(item)
    return sl
