|
|
@ -3,6 +3,7 @@ package org.openrs2.archive.client |
|
|
|
import com.github.ajalt.clikt.core.CliktCommand |
|
|
|
import com.github.ajalt.clikt.core.CliktCommand |
|
|
|
import com.github.ajalt.clikt.parameters.arguments.argument |
|
|
|
import com.github.ajalt.clikt.parameters.arguments.argument |
|
|
|
import com.github.ajalt.clikt.parameters.arguments.multiple |
|
|
|
import com.github.ajalt.clikt.parameters.arguments.multiple |
|
|
|
|
|
|
|
import com.github.ajalt.clikt.parameters.options.flag |
|
|
|
import com.github.ajalt.clikt.parameters.options.option |
|
|
|
import com.github.ajalt.clikt.parameters.options.option |
|
|
|
import com.github.ajalt.clikt.parameters.types.path |
|
|
|
import com.github.ajalt.clikt.parameters.types.path |
|
|
|
import com.google.inject.Guice |
|
|
|
import com.google.inject.Guice |
|
|
@ -14,6 +15,7 @@ public class ImportCommand : CliktCommand(name = "import") { |
|
|
|
private val name by option() |
|
|
|
private val name by option() |
|
|
|
private val description by option() |
|
|
|
private val description by option() |
|
|
|
private val url by option() |
|
|
|
private val url by option() |
|
|
|
|
|
|
|
private val skipErrors by option().flag() |
|
|
|
|
|
|
|
|
|
|
|
private val input by argument().path( |
|
|
|
private val input by argument().path( |
|
|
|
mustExist = true, |
|
|
|
mustExist = true, |
|
|
@ -24,7 +26,7 @@ public class ImportCommand : CliktCommand(name = "import") { |
|
|
|
override fun run(): Unit = runBlocking { |
|
|
|
override fun run(): Unit = runBlocking { |
|
|
|
CloseableInjector(Guice.createInjector(ArchiveModule)).use { injector -> |
|
|
|
CloseableInjector(Guice.createInjector(ArchiveModule)).use { injector -> |
|
|
|
val importer = injector.getInstance(ClientImporter::class.java) |
|
|
|
val importer = injector.getInstance(ClientImporter::class.java) |
|
|
|
importer.import(input, name, description, url) |
|
|
|
importer.import(input, name, description, url, skipErrors) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|