[ python-Feature Requests-1089955 ] optparse .error() should print
options list
SourceForge.net
noreply at sourceforge.net
Wed Jan 5 14:20:51 CET 2005
Feature Requests item #1089955, was opened at 2004-12-22 13:53
Message generated for change (Comment added) made by gward
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1089955&group_id=5470
Category: Python Library
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Mike Orr (hierro)
Assigned to: Greg Ward (gward)
Summary: optparse .error() should print options list
Initial Comment:
Why doesn't optparse.OptionParser.error() print the
list of correct options along with the error message
and usage? This is what the user needs to know
whenever there's an error. One can override this in a
subclass, but it's frustrating to have to do it every
time.
To do this, change the first line in
OptionParser.error() from:
self.print_usage(sys.stderr)
to:
self.print_help(sys.stderr)
print >>sys.stderr
----------------------------------------------------------------------
>Comment By: Greg Ward (gward)
Date: 2005-01-05 08:20
Message:
Logged In: YES
user_id=14422
Because very few conventional Unix programs act this way:
$ -z
ls: invalid option -- z
Try `ls --help' for more information.
$ tar -a
tar: invalid option -- a
Try `tar --help' for more information.
$ cp -z
cp: invalid option -- z
Try `cp --help' for more information.
Note the pattern. (Hmmm: perhaps Optik should throw in a
"try --help" if there's a help option in the current parser.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1089955&group_id=5470
More information about the Python-bugs-list
mailing list