All Downloads are FREE. Search and download functionalities are using the official Maven repository.

caseapp.core.parser.PlatformArgsExpander.scala Maven / Gradle / Ivy

package caseapp.core.parser

import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file._

object PlatformArgsExpander {

  def expand(args: List[String]): List[String] =
    args.flatMap { arg =>
      if (arg.startsWith("@")) {
        val argPath = Paths.get(arg.substring(1))
        val argText = new String(Files.readAllBytes(argPath), UTF_8)
        argText.split(System.lineSeparator).map(_.trim).filter(_.nonEmpty).toList
      }
      else
        List(arg)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy