def split_cli_ids_arg(value):
def parse(el):<EOL><INDENT>el = el.strip()<EOL>if not el:<EOL><INDENT>ret = []<EOL><DEDENT>elif '<STR_LIT:->' in el:<EOL><INDENT>start, end = el.split('<STR_LIT:->', <NUM_LIT:1>)<EOL>ret = xrange(int(start), int(end) + <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>ret = [int(el)]<EOL><DEDENT>return ret<EOL><DEDENT>return set(chain(*(parse(c) for c in value.split('<STR_LIT:U+002C>') if c.strip())))<EOL>
Split ids given in the command line
Possible formats are:
* 1
* 1,2,3,4
* 1-5,20,30,40
Returns respectively
* set([1])
* set([1,2,3,4])
* set([1,2,3,4,5,20,30,40])