comparison mercurial/fancyopts.py @ 959:0aaeee519c66

Fix option parsing bug for empty short options
author mpm@selenic.com
date Fri, 19 Aug 2005 18:56:20 -0800
parents 31a9aa890016
children 4f81068ed8cd
comparison
equal deleted inserted replaced
958:d845a1f174bb 959:0aaeee519c66
8 8
9 for s, l, d, c in options: 9 for s, l, d, c in options:
10 map['-'+s] = map['--'+l]=l 10 map['-'+s] = map['--'+l]=l
11 state[l] = d 11 state[l] = d
12 dt[l] = type(d) 12 dt[l] = type(d)
13 if not d is None and not callable(d): s, l=s+':', l+'=' 13 if not d is None and not callable(d):
14 if s: s += ':'
15 if l: l += '='
14 if s: short = short + s 16 if s: short = short + s
15 if l: long.append(l) 17 if l: long.append(l)
16 18
17 opts, args = getopt.getopt(args, short, long) 19 opts, args = getopt.getopt(args, short, long)
18 20