class SecHubAnalyzerApplication {

    String start(String[] commandLineArguments) throws Exception {

        Analyzer analyzer = new Analyzer();

        CommandLineParser commandLineParser = new DefaultParser();
        Options options = cliOptions();

        CommandLine commandLine = commandLineParser.parse(options, commandLineArguments);

        List<String> files = commandLine.getArgList();

        if (commandLine.hasOption("d")) {
            /* Set LogBack logging level */
            ((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(Level.ALL);

            /* Output message to root logger */
            Logger logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
            logger.info("Detailed output.");
        }

        if (files.isEmpty() || commandLine.hasOption("h")) {
            String header = "\nFind markers in files.\n\n";
            String footer = "\nPlease report issues at https://github.com/daimler/sechub";
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp(APP_NAME, header, options, footer, true);
            return null;
        }

        boolean prettyPrint = false;
        if (commandLine.hasOption("p")) {
            prettyPrint = true;
        }

        AnalyzerResult result = analyzer.analyze(files);
        if (result == null) {
            return null;
        }
        return result.ToJSON(prettyPrint);
    }

}