From 6a6017aec8bb502c674b988acb8b993774dd137a Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 29 Apr 2021 19:31:57 +0200 Subject: Make module name optional in cli (#1850) --- runners/cli/src/main/kotlin/cli/main.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'runners/cli/src/main') diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index 7c402df5..36edb2d9 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -74,7 +74,7 @@ class GlobalArguments(args: Array) : DokkaConfiguration { description = "Document generated or obvious functions like default `toString` or `equals`" ).default(!DokkaDefaults.suppressObviousFunctions) - override val suppressObviousFunctions: Boolean by lazy{ !noSuppressObviousFunctions } + override val suppressObviousFunctions: Boolean by lazy { !noSuppressObviousFunctions } private val _includes by parser.option( ArgTypeFile, @@ -316,7 +316,13 @@ object ArgTypeSourceLinkDefinition : ArgType) : ArgType(true) { override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.DokkaSourceSet = - parseSourceSet(moduleName.value, value.split(" ").filter { it.isNotBlank() }.toTypedArray()) + (if (moduleName.valueOrigin != ArgParser.ValueOrigin.UNSET && moduleName.valueOrigin != ArgParser.ValueOrigin.UNDEFINED) { + moduleName.value + } else { + DokkaDefaults.moduleName + }).let { moduleNameOrDefault -> + parseSourceSet(moduleNameOrDefault, value.split(" ").filter { it.isNotBlank() }.toTypedArray()) + } override val description: kotlin.String get() = "" -- cgit