Code sequence

Report a typo

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.

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.*
              
___

Create a free account to access the full topic