We have written a program that can parse command-line arguments and print the string passed through the arguments as many times as was specified in the second argument. Arrange the lines in the correct order.
Introduction to kotlinx-cli
Code sequence
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
val text by parser.option(ArgType.String, description = "Text to repeat").required()
val times by parser.option(ArgType.Int, description = "Number of times").required()
}
fun main(args: Array<String>) {
println(text)
}
parser.parse(args)
val parser = ArgParser("example")
repeat(times) {
import kotlinx.cli.*
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.