These are chat archives for kbknapp/clap-rs

Jun 2018
Kevin K.
Jun 22 2018 01:16
If you don't compile with the yaml feature then your main function doens't get compiled in that case. A #[cfg(...)] is a conditional compilation attribute, meaning Rust only compiles those particular items if the conditions are met.
To compile the example in the examples/ dir you need to do: $ cargo run --features yaml --example 17_yaml
If you wan to pass further arguments to the example program you can use -- to separate the example args. For example, to pass --help the full command is $ cargo run --features yaml --example 17_yaml -- --help