Mercurial > hg > pyhgsh
comparison mercurial/fancyopts.py @ 1056:34be48b4ca85
Map long option names containing dashes to ones containing underscores.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 24 Aug 2005 22:25:55 -0700 |
parents | 4f81068ed8cd |
children | bf4e7ef08741 |
comparison
equal
deleted
inserted
replaced
1043:9344f5dd4488 | 1056:34be48b4ca85 |
---|---|
5 short='' | 5 short='' |
6 map={} | 6 map={} |
7 dt={} | 7 dt={} |
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 pl = l.replace('-', '_') |
11 state[l] = d | 11 map['-'+s] = map['--'+l] = pl |
12 dt[l] = type(d) | 12 state[pl] = d |
13 dt[pl] = type(d) | |
13 if not d is None and not callable(d): | 14 if not d is None and not callable(d): |
14 if s: s += ':' | 15 if s: s += ':' |
15 if l: l += '=' | 16 if l: l += '=' |
16 if s: short = short + s | 17 if s: short = short + s |
17 if l: long.append(l) | 18 if l: long.append(l) |