Louie Lu added the comment:

Hi all, I've created a PR for this, please help for code review.

I found that previous method from Oz had a problem, that man page and general 
help page will share a Formatter, that cause an unexpected behavior that help 
page will generate with troff format (Unix man page used this format).

I switch to another method that creates a Manpage class and a private 
_ManpageFormatter, we just need to put parser into this Manpage, the __str__ 
method will generate the man page that we want.

This approach prevents help page format affect by ManpageFormatter, and the 
user can happily switching formatter_class to RawDescriptionHelpForatter, 
RawTextHelpForatter and others, since the Manpage class is separate from 
HelpFormatter, and _ManpageFormatter will used the formatter provide from 
parser.

The attach file is a dummy argparser file, you can try it by this:

  ./python poc.py > poc.1 && man ./poc.1

----------
nosy: +louielu
Added file: http://bugs.python.org/file46809/poc.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14102>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to