mercurial/fancyopts.py
changeset 1056 34be48b4ca85
parent 981 4f81068ed8cd
child 1541 bf4e7ef08741
--- a/mercurial/fancyopts.py
+++ b/mercurial/fancyopts.py
@@ -7,9 +7,10 @@ def fancyopts(args, options, state):
     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 += '='