public static void main(String args[]) {
		/* options: <port>, --port=<port>, --debug */
		MUDServer server = null;

		if (args.length < 1) {
			System.out.println("No port number specified. Exiting...");
			System.exit(-1);
		}

		try {
			server = new MUDServer(); // create server

			System.out.println(Arrays.asList(args));

			// process command line parameters
			for (int a = 0; a < args.length; a++) {
				final String s = args[a];

				if (s.startsWith("--")) {
					final String param = s.substring(2, s.length());

					if (param.equals("port")) {
						server.port = Utils.toInt(args[a + 1], DEFAULT_PORT);
						System.out.println("Using port " + server.port);
						System.out.println("");
					}
					else if (param.equals("debug")) {
						server.debug = true;
						System.out.println("Debugging Enabled.");
						System.out.println("");
					}
					else if (param.equals("enable-logging")) {
						server.logging = true;
						System.out.println("Logging Enabled.");
						System.out.println("");
					}
					else if (param.equals("db")) {
						server.DB_FILE = server.DATA_DIR + "databases\\" + args[a + 1];
						System.out.println("Using database " + args[a + 1]);
						// System.out.println("");
					}
					else if (param.equals("dir")) {
						// server.MAIN_DIR = "";
						// server.DATA_DIR = "";
					}
					else if (param.equals("theme")) {
						server.THEME_FILE = server.THEME_DIR + args[a + 1];
						System.out.println("Using theme " + args[a + 1]);
						// System.out.println("");
					}
					else if (param.equals("module")) {
						if (args[a + 1].equals("foe")) {
							server.module = new mud.modules.FalloutEquestria();
						}
						else if (args[a + 1].equals("dnd-fr")) {
							server.module = new mud.modules.DND35();
						}
						else {
							// load and initialize a GameModule subclass?
						}
					}
					else if( param.equals("magic") ) {
						server.magic = true;
					}
					else if (param.equals("setup")) {
						server.firstRun = true;
					}
					else if (param.equals("telnet")) {
						server.telnet = Utils.toInt(args[a + 1], 0);
					}
					else if (param.equals("config-file")) {
						server.readConfigFile(args[a + 1]);
					}
					else if (param.equals("int-login")) {
						server.int_login = true;
					}
					else if (param.equals("use-accounts")) {
						server.use_accounts = true;
					}
					else if (param.equals("test")) {
						server.testing_enabled = true;
					}
				}
			}
		}
		catch (final Exception e) {
			server.debug("Exception(MAIN): " + e.getMessage());
			System.out.println("--- Stack Trace ---");
			e.printStackTrace();
			
			// TODO is a more orderly shutdown possible?
			System.exit(-1);
		}

		server.init();
	}