Skip to content

Instantly share code, notes, and snippets.

@kaubu
Created April 13, 2022 06:25
Show Gist options
  • Save kaubu/fbfd7d8400cfbf15a0e0bd6553fc8500 to your computer and use it in GitHub Desktop.
Save kaubu/fbfd7d8400cfbf15a0e0bd6553fc8500 to your computer and use it in GitHub Desktop.
use std::env;
fn main() {
let argsv: Vec<String> = env::args().collect();
match argsv.len() {
0 | 1 => {},
2 | _ => {
let arg = argsv[1].as_str();
if arg == "CAT" {
println!("Meow");
} else if arg == "DOG" {
println!("Woof");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment