changeset 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 9344f5dd4488
children 2fd15d743b3b
files mercurial/fancyopts.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fancyopts.py	Wed Aug 24 19:19:35 2005 -0700
+++ b/mercurial/fancyopts.py	Wed Aug 24 22:25:55 2005 -0700
@@ -7,9 +7,10 @@
     dt={}
 
     for s, l, d, c in options:
-        map['-'+s] = map['--'+l]=l
-        state[l] = d
-        dt[l] = type(d)
+        pl = l.replace('-', '_')
+        map['-'+s] = map['--'+l] = pl
+        state[pl] = d
+        dt[pl] = type(d)
         if not d is None and not callable(d):
             if s: s += ':'
             if l: l += '='