Accepting parameters on the command line using Rust Clap (English)
- Gabor Szabo
GitHub
LinkedIn
home
Gabor is a Rust, Python, and Perl teacher who also loves helping companies improve their development process by introducing Test Automation, TDD, BDD, CI and other techniques.
Gabor is the maintainer of the Rust in Israel (this), the Python in Israel, and also the Perl in Israel sites though the last one does not get a lot of attention these days.
- Author of Rust Maven
When you start writing a command line application you usually start out with a very limited number of parameters. Maybe just 2 values. In that case using the std::env::args
is enough.
However as you start adding more and more parameters that some of them depend on each other then very quickly you can get in trouble.
The clap crate is an excellent solution for such cases.
In this workshop you'll learn quite a few thing using the Clap crate.
If you have any specific use-case in mind, please comment on this event so I might be able to prepare such an example as well.
The workshop includes presentations and hands-on work.
-
Requirements: Basic familiarity with writing Rust will be enough.