package com.conveyal.r5;

import com.conveyal.r5.analyst.cluster.AnalystWorker;
import com.conveyal.r5.point_to_point.PointToPointRouterServer;

import java.util.Arrays;

/**
 * Main entry point for R5.
 * Currently only supports starting up Analyst components (not plain old journey planning).
 * This will start up either an Analyst worker or a broker depending on the first argument.
 */
public class R5Main {
    public static void main (String... args) throws Exception {
        System.out.println("____/\\\\\\\\\\\\\\\\\\_______/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_         \n" +
                " __/\\\\\\///////\\\\\\____\\/\\\\\\///////////__        \n" +
                "  _\\/\\\\\\_____\\/\\\\\\____\\/\\\\\\_____________       \n" +
                "   _\\/\\\\\\\\\\\\\\\\\\\\\\/_____\\/\\\\\\\\\\\\\\\\\\\\\\\\_____     \n" +
                "    _\\/\\\\\\//////\\\\\\_____\\////////////\\\\\\___    \n" +
                "     _\\/\\\\\\____\\//\\\\\\_______________\\//\\\\\\__   \n" +
                "      _\\/\\\\\\_____\\//\\\\\\___/\\\\\\________\\/\\\\\\__  \n" +
                "       _\\/\\\\\\______\\//\\\\\\_\\//\\\\\\\\\\\\\\\\\\\\\\\\\\/___ \n" +
                "        _\\///________\\///___\\/////////////_____\n");
//        System.out.println("__________________\n" +
//                "___  __ \\__  ____/\n" +
//                "__  /_/ /_____ \\  \n" +
//                "_  _, _/ ____/ /  \n" +
//                "/_/ |_| /_____/   \n" +
//                "                ");

        // Pull argument 0 off as the sub-command,
        // then pass the remaining args (1..n) on to that subcommand.
        String command = args[0];
        String[] commandArguments = Arrays.copyOfRange(args, 1, args.length);
        if ("worker".equals(command)) {
            AnalystWorker.main(commandArguments);
        } else if ("point".equals(command)) {
            PointToPointRouterServer.main(commandArguments);
        } else {
            System.err.println("Unknown command " + command);
        }
    }
}

@@ -1248,275 +1248,8 @@
 n%22);
-%0A//        System.out.println(%22__________________%5Cn%22 +%0A//                %22___  __ %5C%5C__  ____/%5Cn%22 +%0A//                %22__  /_/ /_____ %5C%5C  %5Cn%22 +%0A//                %22_  _, _/ ____/ /  %5Cn%22 +%0A//                %22/_/ %7C_%7C /_____/   %5Cn%22 +%0A//                %22                %22);
 %0A%0A  

remove dead code