-
Notifications
You must be signed in to change notification settings - Fork 30
/
ParserDialog.kt
49 lines (38 loc) · 1.82 KB
/
ParserDialog.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package de.maibornwolff.codecharta.filter.mergefilter
import com.github.kinquirer.KInquirer
import com.github.kinquirer.components.promptConfirm
import com.github.kinquirer.components.promptInput
import de.maibornwolff.codecharta.tools.interactiveparser.ParserDialogInterface
class ParserDialog {
companion object : ParserDialogInterface {
override fun collectParserArgs(): List<String> {
val inputFolderName =
KInquirer.promptInput(message = "What is the folder of cc.json files that has to be merged?")
val outputFileName: String = KInquirer.promptInput(
message = "What is the name of the output file?"
)
val compress: Boolean =
KInquirer.promptConfirm(message = "Do you want to compress the output file?", default = true)
val addMissing: Boolean =
KInquirer.promptConfirm(message = "Do you want to add missing nodes to reference?", default = false)
val recursive: Boolean =
KInquirer.promptConfirm(message = "Do you want to use recursive merge strategy?", default = true)
val leaf: Boolean =
KInquirer.promptConfirm(message = "Do you want to use leaf merging strategy?", default = false)
val ignoreCase: Boolean =
KInquirer.promptConfirm(
message = "Do you want to ignore case when checking node names?",
default = false
)
return listOf(
inputFolderName,
"--output-file=$outputFileName",
"--not-compressed=$compress",
"--add-missing=$addMissing",
"--recursive=$recursive",
"--leaf=$leaf",
"--ignore-case=$ignoreCase"
)
}
}
}