/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.codahale.grpcproxy;

import com.codahale.grpcproxy.HelloWorldClient.Cmd;
import io.airlift.airline.Cli;
import io.airlift.airline.Cli.CliBuilder;
import io.airlift.airline.Help;
import org.slf4j.bridge.SLF4JBridgeHandler;

public class Runner {

  public static void main(String[] args) {
    SLF4JBridgeHandler.removeHandlersForRootLogger();
    SLF4JBridgeHandler.install();

    final CliBuilder<Runnable> builder = Cli.<Runnable>builder("grpc-proxy")
        .withDescription("A set of example services for testing a gRPC proxy service.")
        .withDefaultCommand(Help.class)
        .withCommand(Help.class)
        .withCommand(Cmd.class);

    builder
        .withGroup("server")
        .withDescription("Run a server")
        .withDefaultCommand(Help.class)
        .withCommand(Help.class)
        .withCommand(ProxyRpcServer.Cmd.class)
        .withCommand(LegacyHttpServer.Cmd.class)
        .withCommand(HelloWorldServer.Cmd.class);

    final Cli<Runnable> cli = builder.build();
    cli.parse(args).run();
  }
}

@@ -594,60 +594,8 @@
 y;%0A%0A
-import com.codahale.grpcproxy.HelloWorldClient.Cmd;%0A
 impo
@@ -894,16 +894,88 @@
 tall();%0A
+    cli().parse(args).run();%0A  %7D%0A%0A  private static Cli%3CRunnable%3E cli() %7B
 %0A    fin
@@ -1226,16 +1226,33 @@
 Command(
+HelloWorldClient.
 Cmd.clas
@@ -1566,74 +1566,28 @@
     
-final Cli%3CRunnable%3E cli = builder.build();%0A    cli.parse(args).run
+return builder.build
 ();%0A

Tidy up Runner.