From 74181893a63410be480048d4ac75e5da1875bf8d 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 --- gramps2/src/gramps_main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index f480edd02..5ff239465 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/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)