Source:
public static void main(String[] args) { String repoURI = null; if (args.length > 1 && "--repo".equals(args[0])) { repoURI = args[1]; String[] norepoArgs = new String[args.length - 2]; if (args.length > 2) { System.arraycopy(args, 2, norepoArgs, 0, args.length - 2); } args = norepoArgs; } GlobalContextBuilder.builder(new CLIContextBuilder()); Logging.tryConfigureLogging(); Console consoleReader = new Console(); final GeogigCLI cli = new GeogigCLI(consoleReader); cli.setRepositoryURI(repoURI); GeoGIG geogig = cli.getGeogig(); boolean disableAnsi = false; boolean closeIt = geogig == null; if (closeIt) { geogig = cli.newGeoGIG(Hints.readOnly()); if (geogig.command(ConfigOp.class).setScope(ConfigScope.GLOBAL) .setAction(ConfigAction.CONFIG_GET).setName("ansi.enabled").toString() .equalsIgnoreCase("false")) { disableAnsi = true; } else if (geogig.command(ConfigOp.class).setScope(ConfigScope.GLOBAL) .setAction(ConfigAction.CONFIG_GET).setName("ansi.enabled").toString() .equalsIgnoreCase("true")) { disableAnsi = false; } } else { if (geogig.getRepository().configDatabase().get("ansi.enabled").or("") .equalsIgnoreCase("false")) { cli.getConsole().setForceAnsi(false); disableAnsi = true; } else if (geogig.getRepository().configDatabase().get("ansi.enabled").or("") .equalsIgnoreCase("true")) { disableAnsi = false; cli.getConsole().setForceAnsi(true); } } if (disableAnsi) { cli.getConsole().disableAnsi(); } else { cli.getConsole().enableAnsi(); } addShutdownHook(cli); int exitCode = cli.execute(args); cli.close(); if (exitCode != 0 || cli.isExitOnFinish()) { System.exit(exitCode); } }

Target:
public static void main(String[] args) { String repoURI = null; if (args.length > 1 && "--repo".equals(args[0])) { repoURI = args[1]; String[] norepoArgs = new String[args.length - 2]; if (args.length > 2) { System.arraycopy(args, 2, norepoArgs, 0, args.length - 2); } args = norepoArgs; } GlobalContextBuilder.builder(new CLIContextBuilder()); Logging.tryConfigureLogging(); Console consoleReader = new Console(); final GeogigCLI cli = new GeogigCLI(consoleReader); cli.setRepositoryURI(repoURI); GeoGIG geogig = cli.getGeogig(); boolean disableAnsi = false; boolean closeIt = geogig == null; if (closeIt) { geogig = cli.newGeoGIG(Hints.readOnly()); if (geogig.command(ConfigOp.class).setScope(ConfigScope.GLOBAL) .setAction(ConfigAction.CONFIG_GET).setName("ansi.enabled").toString() .equalsIgnoreCase("false")) { disableAnsi = true; } else if (geogig.command(ConfigOp.class).setScope(ConfigScope.GLOBAL) .setAction(ConfigAction.CONFIG_GET).setName("ansi.enabled").toString() .equalsIgnoreCase("true")) { disableAnsi = false; } geogig.close(); } else { if (geogig.getRepository().configDatabase().get("ansi.enabled").or("") .equalsIgnoreCase("false")) { cli.getConsole().setForceAnsi(false); disableAnsi = true; } else if (geogig.getRepository().configDatabase().get("ansi.enabled").or("") .equalsIgnoreCase("true")) { disableAnsi = false; cli.getConsole().setForceAnsi(true); } } if (disableAnsi) { cli.getConsole().disableAnsi(); } else { cli.getConsole().enableAnsi(); } addShutdownHook(cli); int exitCode = cli.execute(args); cli.close(); if (exitCode != 0 || cli.isExitOnFinish()) { System.exit(exitCode); } }