You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a plugin developer, I want access to the cli options that are pertinent to my plugin during the registration phase. The reason for this is that I may not wish to register my plugin if it's not enabled/configured correctly. The problem is that we have a catch 22 with regards to registering PicoCLIOptions. The only place you can register PicoCLIOptions is in the register method, this is, obviously, too late if you are expecting those parameters to be bound at that point in time.
Obviously, this will not work because enabled will always equal false.
We need a better way of allowing plugin developers to configure command-line arguments.
Options
Add an optional method to the BesuPlugin interface
Something like
voidinitialize(PicoCLIOptionsoptions);
would allow a plugin developer to call addPicoCLIOptions before register is called.
Always mixin BesuPlugin classes
Another option is to always 'mixin' the plugin class. This would mean that a plugin implementor would only be able to register options in a class that implements BesuPlugin. But would not need to explicitly call addPicoCLIOptions anywhere.
Backwards compatibility
Either option, or both, could be added whilst maintaining the current behaviour.
The text was updated successfully, but these errors were encountered:
Description
As a plugin developer, I want access to the cli options that are pertinent to my plugin during the registration phase. The reason for this is that I may not wish to register my plugin if it's not enabled/configured correctly. The problem is that we have a catch 22 with regards to registering PicoCLIOptions. The only place you can register PicoCLIOptions is in the register method, this is, obviously, too late if you are expecting those parameters to be bound at that point in time.
Obviously, this will not work because enabled will always equal false.
We need a better way of allowing plugin developers to configure command-line arguments.
Options
Add an optional method to the
BesuPlugin
interfaceSomething like
would allow a plugin developer to call
addPicoCLIOptions
beforeregister
is called.Always mixin BesuPlugin classes
Another option is to always 'mixin' the plugin class. This would mean that a plugin implementor would only be able to register options in a class that implements
BesuPlugin
. But would not need to explicitly calladdPicoCLIOptions
anywhere.Backwards compatibility
Either option, or both, could be added whilst maintaining the current behaviour.
The text was updated successfully, but these errors were encountered: