pub fn version(binary: &str, matches: &getopts::Matches) -> Option<String> {
    let verbose = match matches.opt_str("version").as_ref().map(|s| s.as_slice()) {
        None => false,
        Some("verbose") => true,
        Some(s) => return Some(format!("Unrecognized argument: {}", s))
    };

    println!("{} {}", binary, option_env!("CFG_VERSION").unwrap_or("unknown version"));
    if verbose {
        fn unw(x: Option<&str>) -> &str { x.unwrap_or("unknown") }
        println!("binary: {}", binary);
        println!("commit-hash: {}", unw(commit_hash_str()));
        println!("commit-date: {}", unw(commit_date_str()));
        println!("host: {}", driver::host_triple());
        println!("release: {}", unw(release_str()));
    }
    None
}
/// Prints version information and returns None on success or an error
/// message on failure.
Prints version information and returns None on success or an error
message on failure.
Prints version information and returns None on success or an error message on failure .
pub fn version(binary: &str, matches: &getopts::Matches) -> Option<String> {
    let verbose = match matches.opt_str("version").as_ref().map(|s| s.as_slice()) {
        None => false,
        Some("verbose") => true,
        Some(s) => return Some(format!("Unrecognized argument: {}", s))
    };
    println!("{} {}", binary, option_env!("CFG_VERSION").unwrap_or("unknown version"));
    if verbose {
        fn unw(x: Option<&str>) -> &str { x.unwrap_or("unknown") }
        println!("binary: {}", binary);
        println!("commit-hash: {}", unw(commit_hash_str()));
        println!("commit-date: {}", unw(commit_date_str()));
        println!("host: {}", driver::host_triple());
        println!("release: {}", unw(release_str()));
    }
    None
}
pub fn version ( binary : & str , matches : & getopts :: Matches ) -> Option < String > { let verbose = match matches . opt_str ( " " ) . as_ref ( ) . map ( | s | s . as_slice ( ) ) { None => false , Some ( " " ) => true , Some ( s ) => return Some ( format ! ( " " s ) ) } ; println ! ( " " binary option_env ( " " ) unwrap_or ( " " ) ) ; if verbose { fn unw ( x : Option < & str > ) -> & str { x . unwrap_or ( " " ) } println ! ( " " binary ) ; println ! ( " " unw ( commit_hash_str ( ) ) ) ; println ! ( " " unw ( commit_date_str ( ) ) ) ; println ! ( " " driver host_triple ( ) ) ; println ! ( " " unw ( release_str ( ) ) ) ; } None }
Prints version information and returns None on success or an error
message on failure.
Prints version information and returns None on success or an error message on failure .
binary
&str
matches
&getopts::Matches
binary
&str
matches
&getopts::Matches