diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index 72fbb48ec96..67a360a882f 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -375,7 +375,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable { @Option( names = {"--genesis-state-hash-cache-enabled"}, - description = "Use genesis state hash from data on startup if specified") + description = + "Use genesis state hash from data on startup if specified (default: ${DEFAULT-VALUE})") private final Boolean genesisStateHashCacheEnabled = false; @Option( diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java index d9882382769..fbed68de0cd 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/ApiConfigurationOptions.java @@ -85,7 +85,7 @@ public ApiConfigurationOptions() {} @CommandLine.Option( names = {"--rpc-max-trace-filter-range"}, description = - "Specifies the maximum number of blocks for the trace_filter method. Must be >=0. 0 specifies no limit (default: $DEFAULT-VALUE)") + "Specifies the maximum number of blocks for the trace_filter method. Must be >=0. 0 specifies no limit (default: ${DEFAULT-VALUE})") private final Long maxTraceFilterRange = 1000L; /** diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index d0c42f67188..23ba593a384 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -2503,4 +2503,16 @@ public void genesisStateHashCacheEnabledShouldWork() throws IOException { assertThat(commandOutput.toString(UTF_8)).isEmpty(); assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); } + + @Test + void helpOutputShouldDisplayCorrectDefaultValues() { + parseCommand("--help"); + + final String commandOutputString = commandOutput.toString(UTF_8); + final String errorOutputString = commandErrorOutput.toString(UTF_8); + + assertThat(commandOutputString).doesNotContain("$DEFAULT-VALUE"); + + assertThat(errorOutputString).isEmpty(); + } }