Hacker News new | ask | show | jobs
by packetlost 353 days ago
I'll take this opportunity to plug lexopt [0] a "pathologically simple CLI opt parser" crate. While I haven't quite had the opportunity to use it, I certainly will the next time it comes up.

[0]: https://docs.rs/lexopt/latest/lexopt/

1 comments

Thanks that actually looks really good! Part of the challenge with some of the crates is that they're great for advanced use but there's so much magic going on with derive macros, which a new Rust programmer won't be familiar with. Most simple CLI programs don't even declare structs so you would have to take a detour to explain that first.
Clap is really nice for more complex CLIs, but I will agree that there's a hefty amount of magic going on that I'm not really a fan of