We need to create a simple program using kotlinx-cli that takes the user's name as an argument and prints a greeting.
Introduction to kotlinx-cli
Create a simple program
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
parser.parse(args)
println("Hello, $name!")
val parser = ArgParser("example")
import kotlinx.cli.*
fun main(args: Array<String>) {
}
val name by parser.option(ArgType.String, description = "Your name").required()
___
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.