Created
July 22, 2013 18:14
-
-
Save potato2003/6056162 to your computer and use it in GitHub Desktop.
かっこいいScala 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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