public static String getOptArg(String longName, String shortName, String[] args, String defaultValue) { return MainArgs.getOptArg(longName, shortName, args, defaultValue); }
public static boolean hasArg(String longName, String shortName, String[] args) { for(String token : args) { if(longName.equals(token) || shortName.equals(token)) { reportChoice(longName, shortName, ""); return true; } } return false; }
public static void main(String[] args) { String home = System.getenv().get("HOME"); String filesPath = MainArgs.getOptArg("files", "-f", args, (null==home?"~":home)+"/www"); String host = MainArgs.getOptArg("host", "-h", args, null); int port = Integer.valueOf(MainArgs.getOptArg("port", "-p", args, "8080")); GraphManager gm = new GraphManager(); populateGraph(gm, host, port, filesPath); gm.enableTelemetry(8089); StageScheduler.defaultScheduler(gm).startup(); }
public static String getOptArg(String longName, String shortName, String[] args, String defaultValue) { String prev = null; for (String token : args) { if (longName.equals(prev) || shortName.equals(prev)) { if (token == null || token.trim().length() == 0 || token.startsWith("-")) { return defaultValue; } return reportChoice(longName, shortName, token.trim()); } prev = token; } return reportChoice(longName, shortName, defaultValue); }
/** * Main entry point that creates an instance of log-telemetry and starts it. * @param args Arguments for starting main */ public static void main(String[] args) { // Get the file path from the arguments String inputFilePath = MainArgs.getOptArg("fileName", "-f", args, "./greenlightning.log"); // Create a new log-telemetry instance, put the output stream on the system log LogTelemetry program = new LogTelemetry(inputFilePath); program.startup(); // 1. load file and all its data into an array // 2. static file hosting of telemetry files // 3. new stage returning each block in rotation }