ababup1192
3/30/2017 - 4:23 AM

Command.scala

object Command extends App{
  val opts = Seq("-a AAA", "-b BBB", "-c CCC")
  val optFlags = Seq(true, false, true)
  println(
      "foo " + opts.zip(optFlags)
        .collect{case (opt, true) => opt}
        .mkString(" ")
    )
}