Macro clap::app_from_crate [−][src]
macro_rules! app_from_crate { () => { ... }; ($sep : expr) => { ... }; }
Expand description
Allows you to build the App instance from your Cargo.toml at compile time.
Equivalent to using the crate_*! macros with their respective fields.
Provided separator is for the crate_authors! macro,
refer to the documentation therefor.
NOTE: Changing the values in your Cargo.toml does not trigger a re-build automatically,
and therefore won’t change the generated output until you recompile.
Pro Tip: In some cases you can “trick” the compiler into triggering a rebuild when your
Cargo.toml is changed by including this in your src/main.rs file
include_str!("../Cargo.toml");
Examples
let m = app_from_crate!().get_matches();