Unknown option handling
svn: r1551
This commit is contained in:
parent
fce16c6be4
commit
74181893a6
@ -142,8 +142,14 @@ class Gramps:
|
|||||||
|
|
||||||
self.cl = 1
|
self.cl = 1
|
||||||
if args:
|
if args:
|
||||||
|
try:
|
||||||
options,leftargs = getopt.getopt(args,
|
options,leftargs = getopt.getopt(args,
|
||||||
const.shortopts,const.longopts)
|
const.shortopts,const.longopts)
|
||||||
|
except getopt.GetoptError,msg:
|
||||||
|
print "Error: %s. Exiting." % msg
|
||||||
|
os._exit(1)
|
||||||
|
except:
|
||||||
|
print "Error parsing arguments: %s " % args
|
||||||
if leftargs:
|
if leftargs:
|
||||||
print "Unrecognized option: %s" % leftargs[0]
|
print "Unrecognized option: %s" % leftargs[0]
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user