3 ms·
I agree that clap v3 (with it's derive capabilities basically incorporating structopt) is awesome. But it's still pretty heavyweight, although you can make it a
by guitarbill 5y ago
I agree that clap v3 (with it's derive capabilities basically incorporating structopt) is awesome. But it's still pretty heavyweight, although you can make it a bit more lightweight by turning off some features. In some cases, I actually put the CLI args in a separate crate, so that changing the program doesn't involve rebuilding the CLI arg structures. As a bonus, it makes changes to the CLI much more obvious in code review.
- epage 5y agoNow that we have clap 3.0 released, trimming the fat is going to be a focus.
- guitarbill 5y agoAh, I've been using the betas and release candidates for a while now. Amazing it's finally stable, thank you. Also, I don't necessarily blame clap for being heavyweight. Argument parsing is hard, and clap does it well - with nice help output! I've also accepted the cost of proc macros (at least while syn is not in the standard library). For me, the derived style where I get populated structures out is well worth it. Of course, any improvement is welcome. But clap works great for me, and is a dependency I happily pull in.
- epage 5y ago> Also, I don't necessarily blame clap for being heavyweight. Argument parsing is hard, and clap does it well - with nice help output! While the feature set justifies some of the cost, I don't want to be complacent about it and excuse any excess as just coming from the feature set. I think we have a lot of room for improvement.
- dbrgn 5y agoHmm, putting them in a subcrate / separate compilation unit is pretty smart. I can imagine that quite a chunk of the compilation time goes into the proc macros :)