Message291836
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 |
|
Date |
User |
Action |
Args |
2017-04-18 14:28:07 | louielu | set | recipients:
+ louielu, rhettinger, bethard, jwilk, eric.araujo, zbysz, dmalcolm, Aaron.Meurer, bignose, andialbrecht, bochecha, tshepang, paul.j3, sigi, Daniel.Walsh, Ingo.Fischer, adregner, josh.r, Oz.Tiram, acucci, matthewjohn |
2017-04-18 14:28:06 | louielu | set | messageid: <1492525686.96.0.424548624973.issue14102@psf.upfronthosting.co.za> |
2017-04-18 14:28:06 | louielu | link | issue14102 messages |
2017-04-18 14:28:06 | louielu | create | |
|