in src/main/java/co/elastic/support/diagnostics/DiagnosticApp.java [25:57]
public static void main(String[] args) {
try(
ResourceCache resourceCache = new ResourceCache();
TextIOManager textIOManager = new TextIOManager();
) {
DiagnosticInputs diagnosticInputs = new DiagnosticInputs("cli");
if (args.length == 0) {
logger.info(Constants.CONSOLE, Constants.interactiveMsg);
diagnosticInputs.interactive = true;
diagnosticInputs.runInteractive(textIOManager);
} else {
List<String> errors = diagnosticInputs.parseInputs(textIOManager, args);
if (errors.size() > 0) {
for (String err : errors) {
logger.error(Constants.CONSOLE, err);
}
diagnosticInputs.usage();
SystemUtils.quitApp();
}
}
Map diagMap = JsonYamlUtils.readYamlFromClasspath(Constants.DIAG_CONFIG, true);
DiagConfig diagConfig = new DiagConfig(diagMap);
DiagnosticService diag = new DiagnosticService();
DiagnosticContext context = new DiagnosticContext(diagConfig, diagnosticInputs, resourceCache, true);
diag.exec(context);
} catch (ShowHelpException she){
SystemUtils.quitApp();
} catch (Exception e) {
logger.error(Constants.CONSOLE,"FATAL ERROR occurred: {}. {}", e.getMessage(), Constants.CHECK_LOG, e);
}
}