icegem-cache-utils/src/main/java/com/googlecode/icegem/cacheutils/Launcher.java
public static void main(String[] args) {
	try {
	    int commandIndex = findCommandIndex(args);

	    if (commandIndex < 0) {
		printHelp();
	    }

	    String[] launcherArgs = extractLauncherArgs(args, commandIndex);
	    String[] commandArgs = extractCommandArgs(args, commandIndex);

	    parseCommandLineArguments(launcherArgs);

	    debug("Launcher#main(): args = " + Arrays.asList(args));
	    debug("Launcher#main(): launcherArgs = " + Arrays.asList(launcherArgs));
	    debug("Launcher#main(): commandArgs = " + Arrays.asList(commandArgs));

	    String commandName = args[commandIndex];

	    Executable tool = Command.getUtil(commandName);
	    
	    if (tool != null) {
		tool.execute(commandArgs, debugEnabled, quiet);
	    } else {
		debug("Launcher#main(): Command \"" + commandName + "\" not found");
		
		printHelp();
	    }
	} catch (Throwable t) {
	    debug("Launcher#main(): Throwable caught with message = " + t.getMessage(), t);
	    
	    Utils.exitWithFailure("Unexpected throwable", t);
	}
    }
public static void main(String[] args) {
	try {
	    int commandIndex = findCommandIndex(args);

	    if (commandIndex < 0) {
		printHelp();
	    }

	    String[] launcherArgs = extractLauncherArgs(args, commandIndex);
	    String[] commandArgs = extractCommandArgs(args, commandIndex);

	    parseCommandLineArguments(launcherArgs);

	    debug("Launcher#main(): args = " + Arrays.asList(args));
	    debug("Launcher#main(): launcherArgs = " + Arrays.asList(launcherArgs));
	    debug("Launcher#main(): commandArgs = " + Arrays.asList(commandArgs));

	    String commandName = args[commandIndex];

	    Executable tool = Command.getUtil(commandName);
	    
	    if (tool != null) {
		tool.execute(commandArgs, debugEnabled, quiet);
	    } else {
		debug("Launcher#main(): Command \"" + commandName + "\" not found");
		
		printHelp();
	    }
	} catch (Throwable t) {
	    debug("Launcher#main(): Throwable caught with message = " + t.getMessage(), t);
	    
	    Utils.exitWithFailure("Unexpected throwable", t);
	}
    }
The entry point of the application.

@param args
- All arguments.
@throws Exception