optionparse: how to add a line break to the help text

G

Gelonida N

I'm having a small question about optionparse.

Normaly optionparser will format the help text according to the
console's width.

I just wondered if there is any way to insert a line breakk into an
options help text.

Example:

from optparse import OptionParser

parser = OptionParser()
parser.add_option("-f", action="store",
help="This option is really really complicated"
" and I'd like to write"
" a few paragrpahs to explain how it works."
"\nHowever the line breaks are stripped off"
" and it's thus difficult to structure the help text")

args = ['-h']
parser.parse_args(args)

Is there any trick to force a new paragraph/ line break before the word
'However'?


Thanks in advance for suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top