From 7eded566a4233599115ff8b80c806a3d5e4bd738 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 20 May 2003 19:21:23 +0000 Subject: [PATCH] Unknown option handling svn: r1551 --- src/gramps_main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)