Fix missing parameters

This commit is contained in:
2025-10-01 18:13:06 +02:00
parent ea43453f07
commit 8a5262d117

View File

@@ -8,12 +8,16 @@ import scala.compiletime.uninitialized
trait BaseOption[T](using conv: ValueConverter[T]) {
protected def createScallop(conf: ScallopConf, group: ScallopOptionGroup): ScallopOption[T]
private var scallop: ScallopOption[T] = uninitialized
def init(scallopConf: ScallopConf, group: ScallopOptionGroup): Unit = scallop = createScallop(scallopConf, group)
def init(scallopConf: ScallopConf, group: ScallopOptionGroup): Unit = {
scallop = createScallop(scallopConf, group)
}
def get: T = scallop()
def get: T = {
scallop()
}
def apply: T = get
def getToolParameters: Seq[Shellable] = Seq(s"--$toolName", getToolArg)
def getToolParameters: Seq[Shellable] = if (scallop.isDefined) Seq(s"--$toolName", getToolArg) else Seq()
def toolName: String
def getToolArg: String = get.toString