This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author louielu
Recipients Aaron.Meurer, Daniel.Walsh, Ingo.Fischer, Oz.Tiram, acucci, adregner, andialbrecht, bethard, bignose, bochecha, dmalcolm, eric.araujo, josh.r, jwilk, louielu, matthewjohn, paul.j3, rhettinger, sigi, tshepang, zbysz
Date 2017-04-18.14:28:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492525686.96.0.424548624973.issue14102@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-04-18 14:28:07louielusetrecipients: + 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:06louielusetmessageid: <1492525686.96.0.424548624973.issue14102@psf.upfronthosting.co.za>
2017-04-18 14:28:06louielulinkissue14102 messages
2017-04-18 14:28:06louielucreate