From 95013783a7b2dcf4f9f2c9a13c2e7d1b0e319b59 Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Thu, 9 Jul 2009 15:08:53 +0100 Subject: [PATCH] Be slightly nicer when option parsing fails --- curses-crossword.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curses-crossword.py b/curses-crossword.py index 92f9b92..19ee754 100644 --- a/curses-crossword.py +++ b/curses-crossword.py @@ -32,7 +32,11 @@ except: filename = None -(options, args) = getopt.getopt(sys.argv[1:], "f:", "file=") +try: + (options, args) = getopt.getopt(sys.argv[1:], "f:", "file=") +except getopt.GetoptError, err: + print str(err) + sys.exit(2) for option in options: if option[0] == "-f" or option[0] == "--file": -- 2.39.5