diff --git a/src/gramps_main.py b/src/gramps_main.py index f480edd02..5ff239465 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -142,8 +142,14 @@ class Gramps: self.cl = 1 if args: - options,leftargs = getopt.getopt(args, - const.shortopts,const.longopts) + try: + options,leftargs = getopt.getopt(args, + 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: print "Unrecognized option: %s" % leftargs[0] os._exit(1)