Synopsis - Issue Tracker

Bug97 Editing

Title Ungraceful backtrace when incorrect commandline arguments used
Created on 2006-03-31.23:50:47 by neiljp, last changed 2006-04-04.01:30:43 by stefan.
assigned to stefan priority low
type severity normal
components general platform GNU/Linux
status closed resolution fixed
depends on superseded by
Add Comment:
File
CC List:? neiljp, stefan

Messages
Author: neiljp Date: 2006-03-31.23:50:47
Incorrect commandline arguments produce a python backtrace dump.
eg.
synopsis -p [no option]
synopsis --p
synopsis --parser

Sample output, currently:
$ ./synopsis -p
Traceback (most recent call last):
  File "./synopsis", line 189, in ?
    main()
  File "./synopsis", line 183, in main
    processor = get_opt(sys.argv[1:])
  File "./synopsis", line 79, in get_opt
    ['output=',
  File "/usr/lib/python2.3/getopt.py", line 91, in getopt
    opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
  File "/usr/lib/python2.3/getopt.py", line 195, in do_shorts
    opt)
getopt.GetoptError: option -p requires argument
Author: neiljp Date: 2006-04-04.01:00:31
A patch which solves this issue.

Also adjusts error message slightly and prints a warning message if a parser is specified more than once (multiple parsers at once don't make sense, do they?). If this is a correct assumption, perhaps the same can be applied to processors/formatters/linkers.
Author: stefan Date: 2006-04-04.01:30:42
The patch I finally checked in (rev:1662) generates
an error if multiple parsers or formatters are
specified. And it reports getopt errors, as per
your patch. Thanks !
Files
File nameUploaded
getopt.patch neiljp, 2006-04-04.01:00:31
History
Date User Action Args
2006-03-31 23:50:48neiljpcreate
2006-04-04 01:00:32neiljpsetfiles: + getopt.patch
messages: + msg534
2006-04-04 01:30:44stefansetstatus: new
assignedto: (no value)
resolution: (no value)
messages: + msg536
nosy: + stefan