All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.cli.commands.OptionsHelper.scala Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package scala.cli.commands

object OptionsHelper {
  implicit class Mandatory[A](x: Option[A]) {
    def mandatory(parameter: String, group: String): A =
      x match {
        case Some(v) => v
        case None =>
          System.err.println(
            s"${parameter.toLowerCase.capitalize} parameter is mandatory for ${group.toLowerCase.capitalize}"
          )
          sys.exit(1)
      }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy