2013-01-29 13:44:46 -06:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-05-22 18:57:53 -05:00
|
|
|
fn parse_args() -> String {
|
2015-02-16 08:04:02 -06:00
|
|
|
let args: Vec<_> = ::std::env::args().collect();
|
2013-01-29 13:44:46 -06:00
|
|
|
let mut n = 0;
|
|
|
|
|
|
|
|
while n < args.len() {
|
2015-02-01 20:53:25 -06:00
|
|
|
match &*args[n] {
|
2014-03-07 15:15:50 -06:00
|
|
|
"-v" => (),
|
2013-01-29 13:44:46 -06:00
|
|
|
s => {
|
2014-05-25 05:17:19 -05:00
|
|
|
return s.to_string();
|
2013-01-29 13:44:46 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
n += 1;
|
|
|
|
}
|
|
|
|
|
2014-05-25 05:17:19 -05:00
|
|
|
return "".to_string()
|
2013-01-29 13:44:46 -06:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2014-01-09 04:06:55 -06:00
|
|
|
println!("{}", parse_args());
|
2013-01-29 13:44:46 -06:00
|
|
|
}
|