X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCLI.py;h=4da436e9d0351a0d943897575c5887a5874c981c;hb=7910222e257368cd534f5334085f008c36e288c6;hp=eb8b21904a53ff622dcecf592f8a8dea481e4b81;hpb=34556a43e5ba2725e00ce097dd2a1cfd3bf21e9e;p=dead%2Fcensus-tools.git diff --git a/src/CLI.py b/src/CLI.py index eb8b219..4da436e 100644 --- a/src/CLI.py +++ b/src/CLI.py @@ -1,9 +1,10 @@ +from optparse import IndentedHelpFormatter from optparse import OptionParser import Configuration.Defaults -def default_option_parser(usage): +def default_option_parser(usage=None): # -h (help) Conflicts with -h HOSTNAME parser = OptionParser(usage=usage, add_help_option = False) @@ -23,3 +24,15 @@ def default_option_parser(usage): default=Configuration.Defaults.DATABASE_USERNAME) return parser + + + +class VerbatimHelpFormatter(IndentedHelpFormatter): + """ + The two HelpFormatters supplied with OptParse like to mangle their + descriptions during print_help(). This subclassed formatter + overrides the format_description() method with an implementation + that simply returns the description unmodified. + """ + def format_description(self, description): + return description