예제 #1
0
  public static void main(String[] args) {
    printWelcomeMessage();
    CliWrapper cliWrapper = new CliWrapper();
    CommandLine commandLine = null;
    try {
      commandLine = cliWrapper.parse(args);
    } catch (ParseException e) {
      printUsage(cliWrapper);
      System.out.println(e.getMessage());
      System.exit(1);
    }

    Configuration configuration =
        ConfigurationBuilder.initFromFile(
            commandLine.getOptionValue(CliOption.CONF.getCommandLineParam()));
    configuration.updateWithCliOptions(commandLine);

    ConnectorFacade facade = getConnectorFacade(configuration);
    new Engine(facade, facade, configuration).run();
  }
예제 #2
0
 private static void printUsage(@NotNull CliWrapper cliOptions) {
   System.out.println(HEADER);
   HelpFormatter helpFormatter = new HelpFormatter();
   helpFormatter.setWidth(WIDTH);
   helpFormatter.printHelp(SPUTNIK, cliOptions.getOptions(), true);
 }