public void execute(CommandLine cl) throws ExecutionException { if (cl.hasOption(optVersion)) { printVersion(); //} else if (cl.hasOption(optInteractive)) { // getConsole().run(); } else if (cl.hasOption(optHelp)) { String cmd = (String) cl.getValue(optHelp); if (cmd == null) { // in this case, the --help is specified after the command // eg: vlt checkout --help Iterator iter = cl.getOptions().iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof Command) { cmd = ((Command) o).getPreferredName(); break; } } } printHelp(cmd); } else { if (!getDefaultContext().execute(cl)) { log.error("Unknown command. Type '--help' for more information."); } } }