mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
Former-commit-id: ab54663fd64f9ae9c758f53b3f5800a5894f0db3 Former-commit-id: 7aba1585ffa45195622bb25e1c62cace474420c9
25 lines
580 B
Kotlin
25 lines
580 B
Kotlin
package net.torvald.terrarum.console
|
|
|
|
import java.nio.file.FileSystems
|
|
import java.nio.file.Files
|
|
|
|
/**
|
|
* Created by minjaesong on 16-03-07.
|
|
*/
|
|
class 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().execute("Usage: batch path/to/batch.txt")
|
|
}
|
|
}
|