package brooklyn.clocker;

import io.airlift.command.Command;

import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import brooklyn.launcher.BrooklynLauncher;


public class Main extends brooklyn.cli.Main {

    private static final Logger log = LoggerFactory.getLogger(Main.class);

    public static void main(String... args) {
        log.debug("CLI invoked with args "+Arrays.asList(args));
        new Main().execCli(args);
    }

    @Override
    protected String cliScriptName() {
        return "clocker";
    }
    
    @Override
    protected Class<? extends BrooklynCommand> cliLaunchCommand() {
        return LaunchCommand.class;
    }

    @Command(name = "clocker", description = "Starts the Brooklyn server with the Clocker console")
    public static class LaunchClocker extends brooklyn.cli.Main.LaunchCommand {
        @Override
        protected BrooklynLauncher createLauncher() {
            return super.createLauncher()
                    .webapp("/", "brooklyn-jsgui.war")
                    .webapp("/clocker", "brooklyn-clocker-console.war");
        }
    }

}

@@ -20,16 +20,58 @@
 ocker;%0A%0A
+import io.airlift.command.Cli.CliBuilder;%0A
 import i
@@ -534,114 +534,19 @@
 ted 
-String cliScriptName() %7B%0A        return %22clocker%22;%0A    %7D%0A    %0A    @Override%0A    protected Class%3C? extends 
+CliBuilder%3C
 Broo
@@ -561,29 +561,23 @@
 and%3E cli
-LaunchCommand
+Builder
 () %7B%0A   
@@ -592,27 +592,59 @@
 urn 
-LaunchCommand
+super.cliBuilder().withCommand(LaunchClocker
 .class
+)
 ;%0A  

Fix addition of clocker command to Main