@SuppressWarnings("unchecked")
  public static void main(String[] args) throws Exception {
    OptionParser parser = new OptionParser();

    ArgumentAcceptingOptionSpec<String> accountJsonFilePathOpt =
        parser.accepts("jsonPath", "The path to the account json file to write to")
            .withRequiredArg()
            .describedAs("account_json_file_path")
            .ofType(String.class);
    ArgumentAcceptingOptionSpec<Short> firstAccountIdOpt = parser.accepts("firstAccountId",
        "The account ID to assign to the first account generated. "
            + "The account ID will be incremented by one for each additional account")
        .withRequiredArg()
        .describedAs("first_account_id")
        .ofType(Short.class);
    NonOptionArgumentSpec<String> serviceIdsArg =
        parser.nonOptions("The service IDs to create accounts for").ofType(String.class);
    parser.accepts("help", "print this help message.");
    parser.accepts("h", "print this help message.");

    OptionSet options = parser.parse(args);
    if (options.has("help") || options.has("h")) {
      parser.printHelpOn(System.out);
      System.exit(0);
    }
    ToolUtils.ensureOrExit(
        Arrays.asList(accountJsonFilePathOpt, firstAccountIdOpt, serviceIdsArg),
        options, parser);
    generateAccounts((List<String>) options.nonOptionArguments(), options.valueOf(accountJsonFilePathOpt),
        options.valueOf(firstAccountIdOpt));
  }
Entry point for the tool.
@param args the command line arguments.
ambry-tools/src/main/java/com/github/ambry/account/ServiceIdAccountGenTool.java