public static void main(final String[] args) {
		String[] newArgs = args;


		if (args.length > 0) {
			boolean runClient = false, spawnProcess = true;
			
			if (args[0].equals("-s")) {
				runClient = false;
				newArgs = copyArgs(args,1, args.length-1);
			} else if (args[0].equals("-c")) {
				runClient = true;
				newArgs = copyArgs(args,1, args.length-1);
			} else if (args[0].equals("-x")) {
				newArgs = copyArgs(args,1, args.length-1);
				spawnProcess = false;
			}

			if (!spawnProcess)
				runThreadedApp(newArgs);
			else if (runClient)
				PledgeControlPanel.main(newArgs);
			else
				PledgeDisplayFrame.main(newArgs);
		} else {
			try {
				String pathToJar = Launcher.class.getProtectionDomain()
                    .getCodeSource().getLocation().toURI().getPath();

				ProcessBuilder pb = new ProcessBuilder("java",
						"-Xmx512m", "-classpath", 
						pathToJar, Launcher.class.getCanonicalName(), "-x");

                pb.start();
			} catch (URISyntaxException e) {
				System.err.println("Could not find Launcher jar path");
			} catch (IOException e) {
                System.err.println("Could not spawn new PhonePledge process: " + e);
                e.printStackTrace();
            }
        }
	}