public static String[] ginit(String[] args) { if (System.getenv("KONOHA_DEBUG") != null) { verboseDebug = true; verboseGc = true; verboseSugar = true; verboseCode = true; } CommandLineParser parser = new BasicParser(); CommandLine commandLine = null; try { commandLine = parser.parse(longOptions, args); } catch (ParseException e) { // TODO } if(commandLine.hasOption("verbose")) { verboseDebug = true; System.out.println("option vervose"); } if(commandLine.hasOption("verbose:gc")) { verboseGc = true; System.out.println("option vervose:gc"); } if(commandLine.hasOption("verbose:sugar")) { verboseSugar = true; System.out.println("option vervose:sugar"); } if(commandLine.hasOption("verbose:code")) { verboseCode = true; System.out.println("option vervose:code"); } if(commandLine.hasOption("interactive")) { interactiveFlag = true; System.out.println("option interactive"); } if(commandLine.hasOption("typecheck")) { compileonlyFlag = true; System.out.println("option typecheck"); } if(commandLine.hasOption("start-with")) { startupScript = commandLine.getOptionValue("start-with"); System.out.println("option start-with"); System.out.println(" with arg " + startupScript); } if(commandLine.hasOption("test")) { testScript = commandLine.getOptionValue("test"); System.out.println(" with arg " + testScript); } if(commandLine.hasOption("test-with")) { testScript = commandLine.getOptionValue("test"); System.out.println(" with arg " + testScript); } if(commandLine.hasOption("builtin-test")) { builtinTest = commandLine.getOptionValue("builtin-test"); System.out.println(" with arg " + builtinTest); } return commandLine.getArgs(); }
public static void startup(CTX konoha, String startup_script) { String[] buf = new String[256]; String path = System.getenv("KONOHA_SCRIPTPATH"); String local = ""; if (path == null) { path = System.getenv("KONOHA_HOME"); local = "/script"; } if (path == null) { path = System.getenv("HOME"); local = "/.konoha/script"; } //TODO snprintf(buf, sizeof(buf), "%s%s%s.k", path, local, startup_script); if (true /*TODO load(konoha, (const char*)buf)*/ ) { System.exit(1); } }