[KLIB tool] Don't print stack trace on CLI args parsing errors
^KT-62340
This commit is contained in:
committed by
Space Team
parent
f220074d8a
commit
1f3da86021
@@ -95,10 +95,10 @@ private fun parseOptions(args: Array<String>): Map<String, List<String>> {
|
|||||||
for (index in args.indices step 2) {
|
for (index in args.indices step 2) {
|
||||||
val key = args[index]
|
val key = args[index]
|
||||||
if (key[0] != '-') {
|
if (key[0] != '-') {
|
||||||
throw IllegalArgumentException("Expected a flag with initial dash: $key")
|
logError("Expected a flag with initial dash: $key")
|
||||||
}
|
}
|
||||||
if (index + 1 == args.size) {
|
if (index + 1 == args.size) {
|
||||||
throw IllegalArgumentException("Expected an value after $key")
|
logError("Expected an value after $key")
|
||||||
}
|
}
|
||||||
val value = listOf(args[index + 1])
|
val value = listOf(args[index + 1])
|
||||||
options[key]?.addAll(value) ?: options.put(key, value.toMutableList())
|
options[key]?.addAll(value) ?: options.put(key, value.toMutableList())
|
||||||
|
|||||||
Reference in New Issue
Block a user