From ef2e5c6cb7aa1fab769770f0a5505365d8541bdc Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 1 Sep 2022 14:00:07 +0200 Subject: [PATCH] Clarify usage options print Update subcommand validation. --- .../provs/server/application/Application.kt | 2 +- .../provs/server/application/CliArgumentsParser.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt index 1ff3e38..c698c39 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/Application.kt @@ -18,7 +18,7 @@ fun main(args: Array) { val checkedArgs = if (args.isEmpty()) arrayOf("-h") else args // validate subcommand - if (!ServerType.values().any {it.name.lowercase() == args[0]}) { + if (!checkedArgs.contains("-h") && !ServerType.values().any {it.name.lowercase() == checkedArgs[0]}) { println("Unknown serverType. Currently only k3s is accepted.") exitProcess(1) } diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentsParser.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentsParser.kt index f6e5b3e..0784974 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentsParser.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/application/CliArgumentsParser.kt @@ -54,7 +54,7 @@ class CliArgumentsParser(name: String) : CliTargetParser(name) { var submodules: List? = null } - class K3s : ServerSubcommand("k3s", "the k3s module") { + class K3s : ServerSubcommand("k3s", "the k3s module, 'provs-server.jar k3s --help' for more info") { val cliConfigFileName by option( ArgType.String, "config-file", @@ -82,7 +82,7 @@ class CliArgumentsParser(name: String) : CliTargetParser(name) { } } - class K3d : ServerSubcommand("k3d", "the k3s module") { + class K3d : ServerSubcommand("k3d", "the k3d module, 'provs-server.jar k3d --help' for more info") { override fun execute() { TODO("Not yet implemented") }