mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
25 lines
582 B
Kotlin
25 lines
582 B
Kotlin
package net.torvald.terrarum.console
|
|
|
|
import java.nio.file.FileSystems
|
|
import java.nio.file.Files
|
|
|
|
/**
|
|
* Created by minjaesong on 2016-03-07.
|
|
*/
|
|
internal object Batch : ConsoleCommand {
|
|
@Throws(Exception::class)
|
|
override fun execute(args: Array<String>) {
|
|
if (args.size == 2) {
|
|
Files.lines(FileSystems.getDefault().getPath(args[1])).forEach(
|
|
{ CommandInterpreter.execute(it) })
|
|
}
|
|
else {
|
|
printUsage()
|
|
}
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo("Usage: batch path/to/batch.txt")
|
|
}
|
|
}
|