Package horizons :: Package util :: Module cmdlineoptions :: Class ManPageFormatter
[hide private]
[frames] | no frames]

Class ManPageFormatter

source code

optparse.HelpFormatter --+
                         |
                        ManPageFormatter

Formatter that extracts our huge option list into manpage format.

Inspired by and mostly copied from this blog post: http://andialbrecht.wordpress.com/2009/03/17/creating-a-man-page-with-distutils-and-optparse/

Instance Methods [hide private]
 
__init__(self, indent_increment=2, max_help_position=24, width=72, short_first=1) source code
 
_markup(self, text) source code
 
optmarkup(self, text)
Highlight flags only
source code
 
format_text(self, text) source code
 
format_usage(self, usage)
Overridden, else it would print 'options.py usage'.
source code
 
format_heading(self, text)
Format an option group..
source code
 
format_option(self, option, *args, **kwargs)
Format a single option.
source code

Inherited from optparse.HelpFormatter: dedent, expand_default, format_description, format_epilog, format_option_strings, indent, set_long_opt_delimiter, set_parser, set_short_opt_delimiter, store_option_strings

Inherited from optparse.HelpFormatter (private): _format_text

Class Variables [hide private]

Inherited from optparse.HelpFormatter: NO_DEFAULT_VALUE

Method Details [hide private]

__init__(self, indent_increment=2, max_help_position=24, width=72, short_first=1)
(Constructor)

source code 
Overrides: optparse.HelpFormatter.__init__

format_usage(self, usage)

source code 

Overridden, else it would print 'options.py usage'.

Overrides: optparse.HelpFormatter.format_usage

format_heading(self, text)

source code 

Format an option group..

Overrides: optparse.HelpFormatter.format_heading

format_option(self, option, *args, **kwargs)

source code 

Format a single option.

The base class takes care to replace custom optparse values.

Overrides: optparse.HelpFormatter.format_option