//! This an example of a verbose cli also it returns error code 0 is wsl or 1 if not) //! # Usage //! ``` //! cargo build --examples //! cargo run --example main -- or cargo run --example main -- --version //! ``` fn main() { if wsl_version::is_wsl() { if std::env::args().len() > 1 && std::env::args().nth(1) == Some("--version".to_string()) { println!( "WSL : Yes, version : {}", wsl_version::version().unwrap_or("") ); } else { println!("WSL : Yes"); } std::process::exit(0); } else { println!("WSL : No"); std::process::exit(-1); } }