mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-06-02 10:39:59 +02:00
add noheader argument to CreateModlist
This commit is contained in:
parent
ec2468aaac
commit
cc08eca061
|
@ -29,6 +29,16 @@ object CreateModlist : AbstractCommand("CreateModlist") {
|
|||
override val helpMessage: String = "This creates a modlist either as html or csv file."
|
||||
|
||||
override fun ArgumentParser.addArgs() {
|
||||
arg("type") {
|
||||
type(CaseInsensitiveEnumNameArgumentType(Format::class.java))
|
||||
help("What format the mod list should be made in")
|
||||
}
|
||||
|
||||
arg("file") {
|
||||
type(FileArgumentType().verifyNotExists())
|
||||
help("What file the mod list should be written to")
|
||||
}
|
||||
|
||||
arg("-s", "--sorting") {
|
||||
default = Sorting.NAME
|
||||
type(CaseInsensitiveEnumNameArgumentType(Sorting::class.java))
|
||||
|
@ -40,14 +50,9 @@ object CreateModlist : AbstractCommand("CreateModlist") {
|
|||
help("If this is set, all relations and not only be mods will be in the list")
|
||||
}
|
||||
|
||||
arg("type") {
|
||||
type(CaseInsensitiveEnumNameArgumentType(Format::class.java))
|
||||
help("What format the mod list should be made in")
|
||||
}
|
||||
|
||||
arg("file") {
|
||||
type(FileArgumentType().verifyNotExists())
|
||||
help("What file the mod list should be written to")
|
||||
arg("-n", "--noheader") {
|
||||
action(storeTrue())
|
||||
help("If this is set, the mod list will not have a header")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +67,7 @@ object CreateModlist : AbstractCommand("CreateModlist") {
|
|||
}
|
||||
|
||||
return when(args.get<Format>("type")!!) {
|
||||
Format.HTML -> doHtml(outFile, all, sorting)
|
||||
Format.HTML -> doHtml(outFile, all, sorting, args.getBoolean("noheader"))
|
||||
Format.CSV -> doCsv(outFile, all, sorting)
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +91,7 @@ object CreateModlist : AbstractCommand("CreateModlist") {
|
|||
return success("Wrote CSV file")
|
||||
}
|
||||
|
||||
private fun doHtml(outFile: File, all: Boolean, sorting: Comparator<MetaData>): CommandReturn {
|
||||
private fun doHtml(outFile: File, all: Boolean, sorting: Comparator<MetaData>, noHeader: Boolean): CommandReturn {
|
||||
fPrintln("Making HTML file $outFile", TERMC.green)
|
||||
val writer = FileWriter(outFile)
|
||||
val html = html {
|
||||
|
@ -102,6 +107,7 @@ object CreateModlist : AbstractCommand("CreateModlist") {
|
|||
}
|
||||
|
||||
"body" {
|
||||
if(!noHeader)
|
||||
"div" {
|
||||
val meta = MPJH.asWrapper!!.json.meta
|
||||
withId("header")
|
||||
|
|
Loading…
Reference in a new issue