Skip to content

Instantly share code, notes, and snippets.

@potato2003
Created July 22, 2013 18:14
Show Gist options
  • Save potato2003/6056162 to your computer and use it in GitHub Desktop.
Save potato2003/6056162 to your computer and use it in GitHub Desktop.
かっこいいScala 1
val (text, status) = args.headOption.collect {
case "new" => newCommand _
case "help" => helpCommand _
}.map { command =>
command(args.drop(1))
}.getOrElse {
(Colors.red("Error"), -1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment