diff --git a/src/main/wacc/Main.scala b/src/main/wacc/Main.scala index ef4575c..35479bd 100644 --- a/src/main/wacc/Main.scala +++ b/src/main/wacc/Main.scala @@ -16,11 +16,6 @@ import com.monovore.decline.Argument import assemblyIR as asm - -case class CliConfig( - file: File = new File(".") -) - given Argument[File] = Argument.from("file") { str => val file = File(str) ( @@ -94,11 +89,14 @@ object Main version = "1.0" ) { def main: Opts[IO[ExitCode]] = - Opts.argument[File]("file").map { file => - compile( - file.getAbsolutePath, - outFile = Some(File(".", file.getName.stripSuffix(".wacc") + ".s")) - ).map(ExitCode(_)) // turn the int into exit code for compatibility with commandioapp - // https://ben.kirw.in/decline/effect.html + Opts.arguments[File]("files").map { files => + files + .parTraverse_ { file => + compile( + file.getAbsolutePath, + outFile = Some(File(".", file.getName.stripSuffix(".wacc") + ".s")) + ) + } + .as(ExitCode.Success) } }