We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82f9845 commit 575de08Copy full SHA for 575de08
examples/17_yaml.rs
@@ -19,6 +19,7 @@ extern crate clap;
19
20
use clap::App;
21
22
+#[cfg(feature = "yaml")]
23
fn main() {
24
// To load a yaml file containing our CLI definition such as the example '17_yaml.yml' we can
25
// use the convenience macro which loads the file at compile relative to the current file
@@ -42,4 +43,11 @@ fn main() {
42
43
} else {
44
println!("--mode <MODE> wasn't used...");
45
}
-}
46
+}
47
+
48
+#[cfg(not(feature = "yaml"))]
49
+fn main() {
50
+ // As stated above, if clap is not compiled with the YAML feature, it is disabled.
51
+ println!("YAML feature is disabled.");
52
+ println!("Pass --features yaml to cargo when trying this example.");
53
0 commit comments