From 2cab9d5514905da08f775ee36749bc899b830232 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sat, 11 Apr 2015 15:25:11 -0400 Subject: [PATCH] editconf.py: better error message if command line arguments are not valid --- tools/editconf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/editconf.py b/tools/editconf.py index 7bc3d190..e3ebfcf2 100755 --- a/tools/editconf.py +++ b/tools/editconf.py @@ -54,6 +54,14 @@ while settings[0][0] == "-" and settings[0] != "--": print("Invalid option.") sys.exit(1) +# sanity check command line +for setting in settings: + try: + name, value = setting.split("=", 1) + except: + import subprocess + print("Invalid command line: ", subprocess.list2cmdline(sys.argv)) + # create the new config file in memory found = set()