mirror of
https://github.com/clap-rs/clap
synced 2025-01-20 16:43:54 +00:00
23 lines
631 B
Rust
23 lines
631 B
Rust
|
#[macro_use]
|
||
|
extern crate clap;
|
||
|
|
||
|
use clap::App;
|
||
|
|
||
|
#[cfg(feature = "unstable")]
|
||
|
fn main() {
|
||
|
App::new("myapp")
|
||
|
.about("does awesome things")
|
||
|
// use crate_authors! to pull the author(s) names from the Cargo.toml
|
||
|
.author(crate_authors!())
|
||
|
.get_matches();
|
||
|
|
||
|
// running the this app with the -h will display whatever author(s) are in your
|
||
|
// Cargo.toml
|
||
|
}
|
||
|
|
||
|
#[cfg(not(feature = "unstable"))]
|
||
|
fn main() {
|
||
|
// if clap is not compiled with the unstable feature, it is disabled.
|
||
|
println!("unstable feature disabled.");
|
||
|
println!("Pass --features unstable to cargo when trying this example.");
|
||
|
}
|