From 9870752d4106c08c10fd70dd5cc35ae8a64c8c8d Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 26 Jun 2017 16:13:23 +0300 Subject: Add deleted cli-parser --- runners/cli/build.gradle | 1 + runners/cli/src/main/kotlin/cli/main.kt | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'runners/cli') diff --git a/runners/cli/build.gradle b/runners/cli/build.gradle index a1d9d4d6..13b0c941 100644 --- a/runners/cli/build.gradle +++ b/runners/cli/build.gradle @@ -4,4 +4,5 @@ sourceCompatibility = 1.6 dependencies { compile project(":core") + compile "com.github.spullara.cli-parser:cli-parser:1.1.1" } diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index 70336b9e..c12166c5 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -1,10 +1,10 @@ package org.jetbrains.dokka +import com.sampullara.cli.Args +import com.sampullara.cli.Argument import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink -import org.jetbrains.kotlin.cli.common.arguments.ValueDescription -import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Args -import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Argument + import java.io.File import java.net.MalformedURLException import java.net.URL @@ -12,35 +12,27 @@ import java.net.URLClassLoader class DokkaArguments { @set:Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)") - @ValueDescription("") var src: String = "" @set:Argument(value = "srcLink", description = "Mapping between a source directory and a Web site for browsing the code") - @ValueDescription("=[#lineSuffix]") var srcLink: String = "" @set:Argument(value = "include", description = "Markdown files to load (allows many paths separated by the system path separator)") - @ValueDescription("") var include: String = "" @set:Argument(value = "samples", description = "Source root for samples") - @ValueDescription("") var samples: String = "" @set:Argument(value = "output", description = "Output directory path") - @ValueDescription("") var outputDir: String = "out/doc/" @set:Argument(value = "format", description = "Output format (text, html, markdown, jekyll, kotlin-website)") - @ValueDescription("") var outputFormat: String = "html" @set:Argument(value = "module", description = "Name of the documentation module") - @ValueDescription("") var moduleName: String = "" @set:Argument(value = "classpath", description = "Classpath for symbol resolution") - @ValueDescription("") var classpath: String = "" @set:Argument(value = "nodeprecated", description = "Exclude deprecated members from documentation") @@ -90,7 +82,7 @@ object MainKt { @JvmStatic fun entry(args: Array) { val arguments = DokkaArguments() - val freeArgs: List = Args.parse(arguments, args, false) ?: listOf() + val freeArgs: List = Args.parse(arguments, args) ?: listOf() val sources = if (arguments.src.isNotEmpty()) arguments.src.split(File.pathSeparatorChar).toList() + freeArgs else freeArgs val samples = if (arguments.samples.isNotEmpty()) arguments.samples.split(File.pathSeparatorChar).toList() else listOf() val includes = if (arguments.include.isNotEmpty()) arguments.include.split(File.pathSeparatorChar).toList() else listOf() @@ -166,7 +158,7 @@ object MainKt { @JvmStatic fun main(args: Array) { val arguments = DokkaArguments() - Args.parse(arguments, args, false) + Args.parse(arguments, args) if (arguments.outputFormat == "javadoc") startWithToolsJar(args) -- cgit