public static void checkInvalidArgs(OptionParser parser,
                                        OptionSet options,
                                        OptionSpec<?> usedOption,
                                        OptionSpec<?>... invalidOptions) {
        if (options.has(usedOption)) {
            for (OptionSpec<?> arg : invalidOptions) {
                if (options.has(arg)) {
                    printUsageAndExit(parser, String.format("Option \"%s\" can't be used with option \"%s\"", usedOption, arg));
                }
            }
        }
    }
Check that none of the listed options are present.
server-common/src/main/java/org/apache/kafka/server/util/CommandLineUtils.java