January 2019
Intermediate to advanced
520 pages
14h 32m
English
When you use the clap crate in your application, you can use command-line parameters to tweak it. The clap crate adds a --help argument, which the user can use to print information about all the arguments. This description was generated automatically by the crate, as can be seen in the following example:
$ ./target/debug/random-service-with-args --helprandom-service-with-env 0.1.0Your NameRust MicroserviceUSAGE: random-service-with-env [OPTIONS]FLAGS: -h, --help Prints help information -V, --version Prints version informationOPTIONS: -a, --address <ADDRESS> Sets an address -c, --config <FILE> Sets a custom config file
Our application successfully printed the usage info: it provided us with all flags, options, and usage variants. If ...
Read now
Unlock full access