Streamline extern-conv stdin/infile

This commit is contained in:
Eike Kettner
2020-02-18 12:43:47 +01:00
parent 0dcc00836b
commit 5869e2ee6e
6 changed files with 68 additions and 93 deletions

View File

@ -18,6 +18,13 @@ object SystemCommand {
def mapArgs(f: String => String): Config =
Config(program, args.map(f), timeout)
def replace(repl: Map[String, String]): Config =
mapArgs(s =>
repl.foldLeft(s) {
case (res, (k, v)) =>
res.replace(k, v)
})
def toCmd: List[String] =
program :: args.toList