besu icon indicating copy to clipboard operation
besu copied to clipboard

repeated CLI args should prevent startup

Open macfarla opened this issue 8 months ago • 6 comments

I would expect besu to not start with this config since it's impossible to determine what is the desired behavior

besu --Xbonsai-full-flat-db-enabled=true --Xbonsai-full-flat-db-enabled=false besu --privacy-enabled=true --privacy-enabled=false besu --p2p-enabled=true --p2p-enabled=false

maybe it's only the case with boolean type args? if I try with --network or --sync-mode I get an aborted start with error message

besu --sync-mode=CHECKPOINT --sync-mode=FULL
option '--sync-mode' (<MODE>) should be specified only once

To display full help:
besu [COMMAND] --help

besu version besu/v25.3-develop-2df5428/osx-aarch_64/oracle_openjdk-java-22

macfarla avatar Apr 02 '25 03:04 macfarla

Perhaps it is arity related with regard to PicoCLI?

jflo avatar Apr 08 '25 15:04 jflo

yes, @jflo , seems to be related to how PicoCLI consumes the options , for single value types (not array, set, lists) the last specified value will override and be used, I am interested to take this a a first issue, should the default behaviour for all single value type options to NOT allow duplicates?

jonathandeclan avatar Apr 24 '25 03:04 jonathandeclan

yes, not allowing duplicates for single value types should be the default behavior. a descriptive error and failing fast should happen if more than one is provided. I'll assign this to you, thanks!

jflo avatar Apr 24 '25 12:04 jflo

@jonathandeclan any progress on this one?

macfarla avatar Jun 12 '25 13:06 macfarla

Hi, I’m interested in this issue. Could you please assign it to me.

pr9t avatar Jun 13 '25 11:06 pr9t

@jonathandeclan any progress on this one?

Started on it target to complete a PR in coming week

jonathandeclan avatar Jun 13 '25 12:06 jonathandeclan