From b3a145ab31d1b9c57c26745685c17e4198978033 Mon Sep 17 00:00:00 2001 From: AJ Date: Sun, 17 Dec 2023 09:49:34 -0800 Subject: [PATCH] Improve support for recursive lazy paraemeters --- .../ajalt/clikt/internal/Finalization.kt | 91 ++++++++++++------- .../com/github/ajalt/clikt/parsers/Parser.kt | 72 +++------------ .../ajalt/clikt/core/CliktCommandTest.kt | 1 + .../ajalt/clikt/parameters/ArgumentTest.kt | 8 +- .../ajalt/clikt/parameters/OptionTest.kt | 13 +++ .../parameters/groups/OptionGroupsTest.kt | 21 ++++- docs/advanced.md | 8 +- docs/options.md | 14 ++- 8 files changed, 118 insertions(+), 110 deletions(-) diff --git a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/internal/Finalization.kt b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/internal/Finalization.kt index db896a1e1..e165aa9ea 100644 --- a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/internal/Finalization.kt +++ b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/internal/Finalization.kt @@ -4,6 +4,8 @@ import com.github.ajalt.clikt.core.Abort import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.core.MultiUsageError import com.github.ajalt.clikt.core.UsageError +import com.github.ajalt.clikt.parameters.arguments.Argument +import com.github.ajalt.clikt.parameters.groups.ParameterGroup import com.github.ajalt.clikt.parameters.options.Option import com.github.ajalt.clikt.parsers.Invocation @@ -12,45 +14,66 @@ internal fun finalizeOptions( options: List