EmbarkStudios / server-framework

Framework for running network services, opinions included
Apache License 2.0
36 stars 4 forks source link

Remove `#[derive(clap::Parser)]` from `Config` #20

Closed davidpdrsn closed 2 years ago

davidpdrsn commented 2 years ago

When integrating this into our internal services we ran into a few oddities that were caused by having #[derive(clap::Parser)] on Config:

With this change Config is becomes just a regular struct. Users can then build then own CLI arg parsing and convert between their config and our config however they want. Thats a bit less convenient but probably worth it overall.

repi commented 2 years ago

if one end up with a lot of small service apps using this and wanting to reduce boilerplate with them one could add this as an optional clap feature that has a small conversion struct from this config to a clap-compatible config. for a fully batteries-included (but optional) approach.

but starting without it and with this feels like the easiest and cleanest.