mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
23 lines
377 B
Rust
23 lines
377 B
Rust
//@ run-pass
|
|
|
|
fn parse_args() -> String {
|
|
let args: Vec<_> = ::std::env::args().collect();
|
|
let mut n = 0;
|
|
|
|
while n < args.len() {
|
|
match &*args[n] {
|
|
"-v" => (),
|
|
s => {
|
|
return s.to_string();
|
|
}
|
|
}
|
|
n += 1;
|
|
}
|
|
|
|
return "".to_string()
|
|
}
|
|
|
|
pub fn main() {
|
|
println!("{}", parse_args());
|
|
}
|