mirror of https://github.com/python/cpython
Added 'translate_longopt()' function.
This commit is contained in:
parent
2f2b6c62ba
commit
68ded6e6f1
|
@ -472,6 +472,13 @@ def wrap_text (text, width):
|
|||
# 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:
|
||||
"""Dummy class just used as a place to hold command-line option
|
||||
values as instance attributes."""
|
||||
|
|
Loading…
Reference in New Issue