]> granicus.if.org Git - python/commitdiff
Added 'translate_longopt()' function.
authorGreg Ward <gward@python.net>
Mon, 25 Sep 2000 01:58:31 +0000 (01:58 +0000)
committerGreg Ward <gward@python.net>
Mon, 25 Sep 2000 01:58:31 +0000 (01:58 +0000)
Lib/distutils/fancy_getopt.py

index eaf60737605b841e1da6d0cc811d924a593d3b26..f93520019f6e7ac92aa6488bfff07d73429b3414 100644 (file)
@@ -470,6 +470,13 @@ def wrap_text (text, width):
     return lines
 
 # wrap_text ()
+
+
+def translate_longopt (opt):
+    """Convert a long option name to a valid Python identifier by
+    changing "-" to "_".
+    """
+    return string.translate(opt, longopt_xlate)
         
 
 class OptionDummy: