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":