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: {}", config::host_triple());
        println!("release: {}", unw(release_str()));
    }
    None
}
/// Prints version information and returns None on success or an error
/// message on panic.
Prints version information and returns None on success or an error
message on panic.
Prints version information and returns None on success or an error message on panic .
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: {}", config::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 ! ( " " config host_triple ( ) ) ; println ! ( " " unw ( release_str ( ) ) ) ; } None }
Prints version information and returns None on success or an error
message on panic.
Prints version information and returns None on success or an error message on panic .
binary
&str
matches
&getopts::Matches