public static boolean isOptionSet(final CommandLine commandLine, final String optionName) {
    return commandLine.getCommandSpec().options().stream()
        .filter(optionSpec -> Arrays.stream(optionSpec.names()).anyMatch(optionName::equals))
        .anyMatch(CommandLineUtils::isOptionSet);
  }
Is the option with that name set on the command line?

@param commandLine the command line
@param optionName the option name to check
@return true if set
app/src/main/java/org/hyperledger/besu/cli/util/CommandLineUtils.java