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

scala.cli.commands.installhome.InstallHomeOptions.scala Maven / Gradle / Ivy

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

import caseapp.*

import scala.cli.ScalaCli.{baseRunnerName, fullRunnerName}
import scala.cli.commands.shared.{GlobalOptions, HasGlobalOptions, HelpGroup}
import scala.cli.commands.tags

// format: off
@HelpMessage(s"Install $fullRunnerName in a sub-directory of the home directory")
final case class InstallHomeOptions(
  @Recurse
    global: GlobalOptions = GlobalOptions(),
  @Group(HelpGroup.Install.toString)
  @Tag(tags.implementation)
    scalaCliBinaryPath: String,
  @Group(HelpGroup.Install.toString)
  @Name("f")
  @Tag(tags.implementation)
  @HelpMessage("Overwrite if it exists")
    force: Boolean = false,
  @Group(HelpGroup.Install.toString)
  @Hidden
  @Tag(tags.implementation)
  @HelpMessage("Binary name")
    binaryName: String = baseRunnerName,
  @Group(HelpGroup.Install.toString)
  @Tag(tags.implementation)
  @HelpMessage("Print the update to `env` variable")
    env: Boolean = false,
  @Group(HelpGroup.Install.toString)
  @Hidden
  @Tag(tags.implementation)
  @HelpMessage("Binary directory")
    binDir: Option[String] = None
) extends HasGlobalOptions {
  // format: on
  lazy val binDirPath = binDir.map(os.Path(_, os.pwd))
}

object InstallHomeOptions {
  implicit lazy val parser: Parser[InstallHomeOptions] = Parser.derive
  implicit lazy val help: Help[InstallHomeOptions]     = Help.derive
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy