RegistryOption does not show possible values with value_switches=False
Adeodato Simó
dato at net.com.org.es
Sun Nov 25 19:09:56 GMT 2007
* John Arbash Meinel [Fri, 26 Oct 2007 10:36:41 -0500]:
Hello,
> Now, you could argue that with value_switches=False it could still
> automatically generate the documentation for those values. Just do it as part
> of the "--format" documentation, rather than doing it as separate options.
[...]
> Either way, I think it would be nice if the options were auto documenting.
> Irrespective of what value_switches was set to.
I tried to implement this, so that tags' --sort option gets useable
help, but it doesn't seem possible to do it right away, because
optparse.OptionParser inconditionally wraps the help for an option as a
single paragraph, even if there are newlines in it.
OptionParser accepts a formatter kwarg, and it will use it instead of
the standard IndentedHelpFormatter, but it would still mean duplicating
most of optparser.HelpFormatter.format_option().
Other option would be to somehow place the documentation for possible
values in a separate paragraph, like it happens with value_switches=True.
I guess for that one could subclass OptionParser. I may try this approach
during the upcoming week.
CCing Aaron in case he has any comments.
Cheers,
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
He who has not a good memory should never take upon himself the trade of lying.
-- Michel de Montaigne
More information about the bazaar
mailing list