Skip to content

Commit 0367045

Browse files
authored
unstable options help - ensure no duplicates (#8662)
* unique options only Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> --------- Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
1 parent 731e940 commit 0367045

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
- Estimate gas on pending block by default [#8627](https://github.com/hyperledger/besu/pull/8627)
1414
- Upgrade Gradle to 8.14 and related plugins [#8638](https://github.com/hyperledger/besu/pull/8638)
1515

16+
### Bug fixes
17+
- Fix `besu -X` unstable options help [#8662](https://github.com/hyperledger/besu/pull/8662)
18+
1619
## 25.5.0
1720
### Breaking Changes
1821
- Changes to gas estimation algorithm for `eth_estimateGas` and `eth_createAccessList` [#8478](https://github.com/hyperledger/besu/pull/8478) - if you require the previous behavior, specify `--estimate-gas-tolerance-ratio=0.0`

besu/src/main/java/org/hyperledger/besu/cli/UnstableOptionsSubCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ private void printUnstableOptions(
8282
final CommandLine.Model.CommandSpec cs = CommandLine.Model.CommandSpec.create();
8383
commandSpec.options().stream()
8484
.filter(option -> option.hidden() && option.names()[0].startsWith("--X"))
85+
.distinct()
8586
.forEach(option -> cs.addOption(option.toBuilder().hidden(false).build()));
8687

8788
if (cs.options().size() > 0) {

besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,14 @@ public void callingVersionDisplayBesuInfoVersion() {
256256
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
257257
}
258258

259+
@Test
260+
public void callingUnstableSubCommandMustNotError() {
261+
parseCommand("-X");
262+
final String expectedOutputStart = "Unstable options";
263+
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
264+
assertThat(commandOutput.toString(UTF_8)).startsWith(expectedOutputStart);
265+
}
266+
259267
// Testing default values
260268
@Test
261269
public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() {

0 commit comments

Comments
 (0)