improve argument parsing

fail fast by parsing arguments before command execution instead of on demand
This commit is contained in:
2025-12-28 00:16:50 +01:00
parent 79629ae68d
commit f1185886d4
2 changed files with 12 additions and 33 deletions

View File

@@ -95,9 +95,7 @@ class Command private constructor(
)
}
fun cli(
block: Command.Builder.() -> Unit,
): Command {
fun cli(block: Command.Builder.() -> Unit): Command {
val builder = Command.Builder(-1, null)
builder.block()
return builder.build()