diff --git a/toolflow/src/main/scala/com/minres/tgc/hammer/options/BaseOption.scala b/toolflow/src/main/scala/com/minres/tgc/hammer/options/BaseOption.scala index f9efd2b..738ae07 100644 --- a/toolflow/src/main/scala/com/minres/tgc/hammer/options/BaseOption.scala +++ b/toolflow/src/main/scala/com/minres/tgc/hammer/options/BaseOption.scala @@ -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