FAQ
Hi,

I'm using optparse for a little Python script.

1. The output from "--help" is:
"""
Usage: script.py <arg>

script.py does something

Options:
-h, --help show this help message and exit
"""

I would prefer to have the description before the usage, like...
"""
script.py does something

Usage: script.py <arg>

Options:
-h, --help show this help message and exit
"""

2. The output from "--doesnotexit" is:
"""
Usage: script.py <arg>

script.py: error: no such option: --doesnotexist
"""

I would prefer to have the error first, then the usage and additionally
the options, like...
"""
script.py: error: no such option: --doesnotexist

Usage: script.py <arg>

Options:
-h, --help show this help message and exit
"""

Is that possible with either optparse or the "new kid on the block"
argparse. If so how?

Thorsten

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedMay 12, '11 at 1:38p
activeMay 21, '11 at 9:53p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase