private static void config(String[] args, Gui gui) {
		if (args.length == 0) {
			gui.setConfigLocation(null, null);
			return; // no configuration
		}
		if (args.length != 2 || !"-conf".equals(args[0]))
			printHelpThenExit();
		JSONParser parser = new JSONParser();
		try {
			JSONObject json = (JSONObject) parser.parse(new FileReader(args[1]));
			initGuiConfig(json, gui);
			ProjectConf defConf = createProjectDefaults(json);
			gui.setDefaultProjectConf(defConf);
			startProjects(json, defConf, gui);
			gui.showGui();
		} catch (FileNotFoundException e) {
			System.err.println("File not found: " + args[1]);
			System.exit(1);
		} catch (IOException e) {
			System.err.println("I/O error when reading file: " + args[1]);
			System.exit(1);
		} catch (ParseException e) {
			System.err.println("Bad JSON syntax: " + e.getMessage());
			System.exit(1);
		} catch (BadConfig e) {
			System.err.println("Bad configuration: " + e.getMessage());
			System.exit(1);
		} catch (InvalidParameterException e) {
			System.err.println("Bad configuration: " + e.getMessage());
			System.exit(1);
		}
	}