private Optional<String> getKeyName(final OptionSpec spec) {
    // If any of the names of the option are used as key in the toml results
    // then returns the value of first one.
    Optional<String> keyName =
        Arrays.stream(spec.names())
            // remove leading dashes on option name as we can have "--" or "-" options
            .map(name -> name.replaceFirst("^-+", ""))
            .filter(result::contains)
            .findFirst();

    if (keyName.isEmpty()) {
      // If the base key name doesn't exist in the file it may be under a TOML table heading
      // e.g. TxPool.tx-pool-max-size
      keyName = getDottedKeyName(spec);
    }

    return keyName;
  }
Creates a new TomlConfigurationDefaultProvider from an input stream.

@param commandLine the command line
@param inputStream the input stream
@return a new TomlConfigurationDefaultProvider
app/src/main/java/org/hyperledger/besu/cli/util/TomlConfigurationDefaultProvider.java