io.redskap.swagger.brake.cli.Cli Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagger-brake Show documentation
Show all versions of swagger-brake Show documentation
Swagger contract checker for breaking API changes
package io.redskap.swagger.brake.cli;
import io.redskap.swagger.brake.cli.options.CliHelpException;
import io.redskap.swagger.brake.cli.options.CliOptions;
import io.redskap.swagger.brake.cli.options.CliOptionsProvider;
import io.redskap.swagger.brake.runner.Options;
import io.redskap.swagger.brake.runner.Starter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
@Slf4j
public class Cli {
private final CliOptionsProvider optionsProvider;
public void start() {
try {
Options options = optionsProvider.provide();
Starter.start(options);
} catch (CliHelpException e) {
log.info(e.getMessage());
} catch (Exception e) {
log.debug("Exception occured", e);
log.error(e.getMessage());
log.error("For help please use " + CliOptions.getAsCliOption(CliOptions.HELP));
}
}
}