From: Greg Ward Date: Mon, 25 Sep 2000 01:58:31 +0000 (+0000) Subject: Added 'translate_longopt()' function. X-Git-Tag: v2.0b2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68ded6e6f148ef0dc95418be7a9bb61385942362;p=thirdparty%2FPython%2Fcpython.git Added 'translate_longopt()' function. --- diff --git a/Lib/distutils/fancy_getopt.py b/Lib/distutils/fancy_getopt.py index eaf60737605b..f93520019f6e 100644 --- a/Lib/distutils/fancy_getopt.py +++ b/Lib/distutils/fancy_getopt.py @@ -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: