January 2019
Intermediate to advanced
520 pages
14h 32m
English
The process of building a parser is quite simple. You will create an App instance and feed this type with the Arg instances. The App also has methods that can be used to set information about the application. Add the following code to the main function of our server:
let matches = App::new(crate_name!()) .version(crate_version!()) .author(crate_authors!()) .about(crate_description!()) .arg(Arg::with_name("address") .short("a") .long("address") .value_name("ADDRESS") .help("Sets an address") .takes_value(true)) .arg(Arg::with_name("config") .short("c") .long("config") .value_name("FILE") .help("Sets a custom config file") .takes_value(true)) .get_matches();
First, we create an App instance with a new method that expects the ...
Read now
Unlock full access