Adding in/out file validation

This commit is contained in:
2025-10-02 20:47:12 +02:00
parent 47614ad47f
commit 22a1f31683
7 changed files with 65 additions and 9 deletions

View File

@@ -1,6 +1,9 @@
package com.minres.tgc.hammer
import ch.qos.logback.classic.Level
import com.minres.tgc.hammer.cli.{HammerConf, MySubcommand}
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
import scala.compiletime.uninitialized
@@ -8,8 +11,19 @@ object Main {
var conf: HammerConf = uninitialized
def main(args: Array[String]): Unit = {
var logger = Logger("TGCHammer")
conf = new HammerConf(args.toIndexedSeq)
val logLevel = conf.verbose() match {
case 0 => Level.WARN
case 1 => Level.INFO
case 2 => Level.DEBUG
case _ => Level.TRACE
}
LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME).asInstanceOf[ch.qos.logback.classic.Logger].setLevel(logLevel)
os.makeDir(Global.OUT_DIR)
os.makeDir(Global.TMP_DIR)
conf.subcommand match {
case Some(c: MySubcommand) =>
val tasks = c.getRequiredTasks