4 ms·
You do not "need a framework" to build simple CLI tools in Rust. Most people use a command line argument parser, the most popular being clap [0]. Or you can jus
by ibraheemdev 6y ago
You do not "need a framework" to build simple CLI tools in Rust. Most people use a command line argument parser, the most popular being clap [0]. Or you can just use std::env directly.
0: https://github.com/clap-rs/clap https://github.com/clap-rs/clap
- masklinn 6y agoOr you can use getopts if that's your thing (it's also a library so limited gain over clap/structop, probably smaller & faster to compile though) e.g. that's what Brian Cantrill does[0] because they're an old fogey[1] :D [0] https://github.com/joyent/statemap/blob/rust/src/main.rs#L95 https://github.com/joyent/statemap/blob/rust/src/main.rs#L95 [1] https://github.com/joyent/statemap/pull/41 https://github.com/joyent/statemap/pull/41
- bcantrill 6y agoNot only had I entirely forgotten about that, I now use structopt for everything -- so at least this old dog can still learn new tricks? ;)