optparse: add trailing text in help message?

Count László de Almásy calmasy at gmail.com
Fri Oct 13 13:09:45 EDT 2006


Is there a standard way with optparse to include a blurb of text after
the usage section, description, and the list of options?  This is
often useful to include examples or closing comments when the help
message is printed out.  Many of the GNU commands do this.

It would look something like this:

% program --help

usage: program [options]

This is my description text.

options:
  -f BAR, --foo=BAR
                 A sample option
  --version   show program's version number and exit
  --help       show this help message and exit

==> Now how about closing text after the options list?



More information about the Python-list mailing list