Skip to content

Instantly share code, notes, and snippets.

@richo
Last active August 29, 2015 14:00
Show Gist options
  • Save richo/11102893 to your computer and use it in GitHub Desktop.
Save richo/11102893 to your computer and use it in GitHub Desktop.
let args = ~["foo", "bar"];
// Or something like
// let args = ~["qux", "naz", "b9rk"]
match args.as_slice() {
["foo", arg] => handle_foo(arg),
["qux", a1, a2] => handle_qux(a1, a2),
_ => usage()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment