[skip ci] fix empty arguments exception

This commit is contained in:
ansgarz 2022-02-22 17:42:40 +01:00
parent 640c0bd090
commit c8e880eba4

View file

@ -13,7 +13,9 @@ import kotlin.system.exitProcess
*/ */
fun main(args: Array<String>) { fun main(args: Array<String>) {
val cmd = CliArgumentsParser("java -jar provs-server.jar").parseCommand(args) val checkedArgs = if (args.size == 0) arrayOf("-h") else args
val cmd = CliArgumentsParser("java -jar provs-server.jar").parseCommand(checkedArgs)
if (!cmd.isValid()) { if (!cmd.isValid()) {
println("Arguments are not valid, pls try -h for help.") println("Arguments are not valid, pls try -h for help.")
exitProcess(1) exitProcess(1)