From 6eaea433d8254c6fd1ce745d0b699a54de9c434e Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Wed, 20 Dec 2023 21:43:11 +0800 Subject: [PATCH] refactor: extract picker --- unit-cli/src/main/kotlin/cc/unitmesh/runner/Picker.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/unit-cli/src/main/kotlin/cc/unitmesh/runner/Picker.kt b/unit-cli/src/main/kotlin/cc/unitmesh/runner/Picker.kt index d0fbebbf..6222b937 100644 --- a/unit-cli/src/main/kotlin/cc/unitmesh/runner/Picker.kt +++ b/unit-cli/src/main/kotlin/cc/unitmesh/runner/Picker.kt @@ -17,7 +17,9 @@ private val logger = org.slf4j.LoggerFactory.getLogger(PickerCommand::class.java fun main(args: Array) = PickerCommand().main(args) class PickerCommand : CliktCommand() { - val completionTypeSize by option(help = "Limit each CompletionType size").int().default(500) + private val completionTypeSize by option(help = "Limit each CompletionType size").int().default(500) + private val gitDepth by option(help = "Git depth").int().default(1) + private val maxCompletionInOneFile by option(help = "Max completion in one file").int().default(3) override fun run() { val outputDir = File("datasets" + File.separator + "origin") @@ -40,8 +42,8 @@ class PickerCommand : CliktCommand() { url = code.repository, branch = code.branch, language = code.language, - maxCompletionInOneFile = 3, - gitDepth = 1, + maxCompletionInOneFile = maxCompletionInOneFile, + gitDepth = gitDepth, completionTypeSize = completionTypeSize )