blob: b35740c49b213d7dc4d106befac133bdb4806a31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package commando
object `package` {
def parse(command: Command,
arguments: Seq[String]): Either[ParseException, CommandLine] =
Parser.parse(command, arguments)
def parseOrExit(command: Command, arguments: Seq[String])(
action: CommandLine => Any): Unit = parse(command, arguments) match {
case Left(ex) =>
System.err.println(ex.getMessage)
System.exit(1)
case Right(res) => action(res)
}
}
|