Skip to content

Conversation

@Seanstoppable
Copy link
Contributor

I've always felt that module setup is a bit verbose.
With the recent complaints about module contributions have friction, I wanted to take a crack at drying up the boilerplate a bit in order to reduce problems I have seen when building modules.

  1. Remove unused Help() method. Noting uses it.
  2. Add some base config handling for scanner and module. This lets us define protocol, default port and description in one place, as opposed to split across several methods.
  3. Stop repeating the dialerconfig method

I think there are some opportunities for cleaning up the following as well, but I'll need to restretch my legs:

  • GetName and GetTrigger are all the same. They derive from BaseFlags, which we embed in our config
  • As I commented, if we do some of this, AddCommand can be simplified to just take a module
  • InitPerSender is repeated everywhere

Notes & Caveats

Some part of this change does seem to have somehow broken the multiple module

There is a ton of boilerplate in modules
My experience is that there is just so much it makes it harder than
necessary to write one and/or miss a field that should be updated

Start by cleaning up unused methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant