1.1 --- a/lplc Thu Mar 02 01:38:05 2017 +0100
1.2 +++ b/lplc Thu Mar 02 17:18:12 2017 +0100
1.3 @@ -183,6 +183,7 @@
1.4 verbose = False
1.5 warnings = []
1.6
1.7 + unrecognised = []
1.8 filenames = []
1.9 outputs = []
1.10
1.11 @@ -204,6 +205,7 @@
1.12 elif arg.startswith("-o"): l, needed = start_arg_list(outputs, arg, "-o", 1)
1.13 elif arg == ("-v", "--verbose"): verbose = True
1.14 elif arg.startswith("-W"): l, needed = start_arg_list(warnings, arg, "-W", 1)
1.15 + elif arg.startswith("-"): unrecognised.append(arg)
1.16 else:
1.17 l.append(arg)
1.18 if needed:
1.19 @@ -212,6 +214,12 @@
1.20 if needed == 0:
1.21 l = filenames
1.22
1.23 + # Report unrecognised options.
1.24 +
1.25 + if unrecognised:
1.26 + print >>sys.stderr, "The following options were not recognised: %s" % ", ".join(unrecognised)
1.27 + sys.exit(1)
1.28 +
1.29 # Add extra components to the module search path from the environment.
1.30
1.31 if not ignore_env: