fvaleri commented on code in PR #13983: URL: https://github.com/apache/kafka/pull/13983#discussion_r1266396090
########## tools/src/main/java/org/apache/kafka/tools/StreamsResetter.java: ########## @@ -133,77 +112,69 @@ public class StreamsResetter { + "*** Warning! This tool makes irreversible changes to your application. It is strongly recommended that " + "you run this once with \"--dry-run\" to preview your changes before making them.\n\n"; - private OptionSet options = null; private final List<String> allTopics = new LinkedList<>(); - - public int run(final String[] args) { - return run(args, new Properties()); + public static void main(final String[] args) { + Exit.exit(new StreamsResetter().execute(args)); } - public int run(final String[] args, - final Properties config) { - int exitCode; + public int execute(final String[] args) { + return execute(args, new Properties()); + } - Admin adminClient = null; + public int execute(final String[] args, final Properties config) { try { - parseArguments(args); - - final boolean dryRun = options.has(dryRunOption); + StreamsResetterOptions options = new StreamsResetterOptions(args); - final String groupId = options.valueOf(applicationIdOption); - final Properties properties = new Properties(); - if (options.has(commandConfigOption)) { - properties.putAll(Utils.loadProps(options.valueOf(commandConfigOption))); + String groupId = options.applicationId(); Review Comment: If we want this, we should enforce the same checkstyle rule. This is too strict IMO. Wdyt? ########## tools/src/main/java/org/apache/kafka/tools/StreamsResetter.java: ########## @@ -133,77 +112,69 @@ public class StreamsResetter { + "*** Warning! This tool makes irreversible changes to your application. It is strongly recommended that " + "you run this once with \"--dry-run\" to preview your changes before making them.\n\n"; - private OptionSet options = null; private final List<String> allTopics = new LinkedList<>(); - - public int run(final String[] args) { - return run(args, new Properties()); + public static void main(final String[] args) { + Exit.exit(new StreamsResetter().execute(args)); } - public int run(final String[] args, - final Properties config) { - int exitCode; + public int execute(final String[] args) { + return execute(args, new Properties()); + } - Admin adminClient = null; + public int execute(final String[] args, final Properties config) { try { - parseArguments(args); - - final boolean dryRun = options.has(dryRunOption); + StreamsResetterOptions options = new StreamsResetterOptions(args); - final String groupId = options.valueOf(applicationIdOption); - final Properties properties = new Properties(); - if (options.has(commandConfigOption)) { - properties.putAll(Utils.loadProps(options.valueOf(commandConfigOption))); + String groupId = options.applicationId(); Review Comment: If we want this, we should enforce the same checkstyle rule. This is too strict IMO. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org