1.4.0 release #9

Merged
Infendro merged 20 commits from develop into main 2026-01-10 07:37:21 +00:00
Showing only changes of commit 47834c91d8 - Show all commits

View File

@@ -31,7 +31,7 @@ internal class ContextParser(
private val current: String
get() = args[index]
private val next: String?
get() = args.getOrNull(index)
get() = args.getOrNull(index + 1)
private fun hasNext() = index < args.size
private fun consume() {
@@ -121,7 +121,7 @@ internal class ContextParser(
else -> {
if (next?.startsWith('-') == false) {
consume()
trimmed to next
trimmed to current
} else {
trimmed to null
}
@@ -139,7 +139,7 @@ internal class ContextParser(
val value = when {
text != null ->
when (val result = option.parser.parse(current)) {
when (val result = option.parser.parse(text)) {
is Parser.Result.Success<*> -> result.value
is Parser.Result.Failure<*> -> return failure(path, result.failure)
}