package com.conveyal.r5;

import com.conveyal.r5.analyst.broker.BrokerMain;
import com.conveyal.r5.analyst.cluster.AnalystWorker;

import java.util.Arrays;

/**
 * Main entry point for R5.
 */
public class R5Main {
    public static void main (String... args) {
        String command = args[0];

        String[] cargs = new String[args.length - 1];
        System.arraycopy(args, 1, cargs, 0, cargs.length);

        if ("broker".equals(command)) {
            BrokerMain.main(cargs);
        } else if ("worker".equals(command)) {
            AnalystWorker.main(cargs);
        }
    }
}

@@ -188,213 +188,482 @@
 .%0A *
-/%0Apublic class R5Main %7B%0A    public static void main (String... args) %7B%0A        String command = args%5B0%5D;%0A%0A        String%5B%5D cargs = new String%5Bargs.length - 1%5D;%0A        System.a
+ Currently only supports starting up Analyst components (not plain old journey planning).%0A * This will start up either an Analyst worker or a broker depending on the first argument.%0A */%0Apublic class R5Main %7B%0A    public static void main (String... args) %7B%0A        // Pull argument 0 off as the sub-command,%0A        // then pass the remaining args (1..n) on to that subcommand.%0A        String command = args%5B0%5D;%0A        String%5B%5D commandArguments = A
 rray
+s.
 copy
-(args, 1, c
+OfRange(
 args, 
-0
+1
 , 
-c
 args
@@ -672,17 +672,16 @@
 ength);%0A
-%0A
         
@@ -737,27 +737,38 @@
 rMain.main(c
-arg
+ommandArgument
 s);%0A        
@@ -838,19 +838,30 @@
 r.main(c
-arg
+ommandArgument
 s);%0A    

add comments. Use Arrays.copyOfRange for clarity.