Use this library to unify how you get configuration options from
- The command line arguments
- Config Files
- Environmant Variables
use clap_conf::prelude::*;
let matches = clap_app!(my_app=>
(@arg filename:-f +takes_value "the input filename")
).get_matches();
let cfg = with_toml_env(&matches,&["toml/config/locations"]);
let filename =
cfg.grab().arg("filename").conf("input.filename").env("MY_APP_INPUT_FILE").def("default.file");
assert_eq!(filename,"default.file".to_string());
clap_app | Build App , Arg s, SubCommand s and Group s with Usage-string like input
but without the associated parsing runtime cost.
|
crate_version | Allows you to pull the version from your Cargo.toml at compile time as
MAJOR.MINOR.PATCH_PKGVERSION_PRE
|
ArgMatches | Used to get information about the arguments that where supplied to the program at runtime by
the user. New instances of this struct are obtained by using the App::get_matches family of
methods.
|
Values | An iterator for getting multiple values out of an argument via the ArgMatches::values_of
method.
|