Fix missing parameters
This commit is contained in:
@@ -8,12 +8,16 @@ import scala.compiletime.uninitialized
|
|||||||
trait BaseOption[T](using conv: ValueConverter[T]) {
|
trait BaseOption[T](using conv: ValueConverter[T]) {
|
||||||
protected def createScallop(conf: ScallopConf, group: ScallopOptionGroup): ScallopOption[T]
|
protected def createScallop(conf: ScallopConf, group: ScallopOptionGroup): ScallopOption[T]
|
||||||
private var scallop: ScallopOption[T] = uninitialized
|
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 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 toolName: String
|
||||||
def getToolArg: String = get.toString
|
def getToolArg: String = get.toString
|
||||||
|
Reference in New Issue
Block a user