fix command groups

This commit is contained in:
2025-10-01 18:53:49 +02:00
parent 39f0e052c1
commit 66fb0e24c8
3 changed files with 7 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ trait BaseOption[T](using conv: ValueConverter[T]) extends ConfigElement {
def get: T = scallop()
def apply: T = get
def getToolParameters: Seq[Shellable] = if (scallop.isDefined) Seq(s"--$toolName", getToolArg) else Seq()
def getToolParameters: Seq[Shellable] = if (scallop.isDefined) Seq(s"$toolName", getToolArg) else Seq()
def toolName: String
def getToolArg: String = get.toString

View File

@@ -5,8 +5,8 @@ import os.Shellable
class CommandGroup(name: String) extends BaseGroup {
override def getToolParameters: Seq[Shellable] = {
val sub = options.toSeq.map(_.getToolParameters)
Seq(s"""--$name="${sub.flatMap(_.value).mkString(" ")}"""")
val sub = options.toSeq.map(_.getToolParameters.map(_.value).mkString("="))
Seq(s"""$name="${sub.mkString(" ")}"""")
}
override def init(scallopConf: ScallopConf, group: ScallopOptionGroup): Unit = {

View File

@@ -7,13 +7,13 @@ import org.rogach.scallop.*
class SchedulingParameters extends OptionGroup {
override def name: String = "Longnail Scheduling Args"
add(new CommandGroup("prepare-schedule-lil") {
add(new CommandGroup("--prepare-schedule-lil") {
choiceS(Seq("LEGACY", "MS", "PAMS", "PARAMS", "MI_MS", "MI_PAMS", "MI_PARAMS"), name = "schedulingAlgo", default = Some("LEGACY"))
value[Path](cliName = "cellLibrary", toolName = "library")
valueS[Path](name = "opTyLibrary")
})
add(new CommandGroup("schedule-lil") {
add(new CommandGroup("--schedule-lil") {
valueS[Int](name = "schedulingTimeout")
value[Int](cliName = "schedulingRefineTimeout", toolName = "schedRefineTimeout")
value[Path](cliName = "schedulingKconf", toolName = "solSelKconfPath")
@@ -22,6 +22,6 @@ class SchedulingParameters extends OptionGroup {
value[Int](cliName = "clockPeriod", toolName = "clockTime")
})
value[Int](cliName = "maxLoopUnrollFactor", toolName = "max-unroll-factor")
value[Path](cliName = "schedulingMLIR", toolName = "o")
value[Int](cliName = "--maxLoopUnrollFactor", toolName = "max-unroll-factor")
value[Path](cliName = "--schedulingMLIR", toolName = "o")
}