2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-01-02 13:11:41 +00:00
|
|
|
|
2014-05-22 23:57:53 +00:00
|
|
|
fn parse_args() -> String {
|
2015-02-16 14:04:02 +00:00
|
|
|
let args: Vec<_> = ::std::env::args().collect();
|
2013-01-29 19:44:46 +00:00
|
|
|
let mut n = 0;
|
|
|
|
|
|
|
|
while n < args.len() {
|
2015-02-02 02:53:25 +00:00
|
|
|
match &*args[n] {
|
2014-03-07 21:15:50 +00:00
|
|
|
"-v" => (),
|
2013-01-29 19:44:46 +00:00
|
|
|
s => {
|
2014-05-25 10:17:19 +00:00
|
|
|
return s.to_string();
|
2013-01-29 19:44:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
n += 1;
|
|
|
|
}
|
|
|
|
|
2014-05-25 10:17:19 +00:00
|
|
|
return "".to_string()
|
2013-01-29 19:44:46 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2014-01-09 10:06:55 +00:00
|
|
|
println!("{}", parse_args());
|
2013-01-29 19:44:46 +00:00
|
|
|
}
|