[PATCH] fix "yum --help" with translated "Usage: %s\n". BZ 1033416
zpavlas at redhat.com
Wed Jan 8 16:47:53 UTC 2014
> Did you try undoing the _wrapOptParseUsage() stuff to see if that
removing the callback=self._wrapOptParseUsage stuff didn't help,
in fact I'm not sure why it's there..
> Is it worth just re-implementing self.optparser.format_usage() within
It's possible but quite hairy. format_usage() is not a method of OptionParser
(that we already subclass), but of IndentedHelpFormatter. One can select
a different than the built-in formatter with OptionParse(formatter=...).
We'd have to override format_heading() too, since it uses _("Options")
(that apparently was not localized, otherwise we'd get a different traceback).
Patching optparse._ fixes both at once.
More information about the Yum-devel