在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ajalt/clikt开源软件地址(OpenSource Url):https://github.com/ajalt/clikt开源编程语言(OpenSource Language):Kotlin 99.6%开源软件介绍(OpenSource Introduction):Clikt (pronounced "clicked") is a multiplatform Kotlin library that makes writing command line interfaces simple and intuitive. It's the "Command Line Interface for Kotlin". It is designed to make the process of writing command line tools effortless while supporting a wide variety of use cases and allowing advanced customization when needed. Clikt has:
What does it look like? Here's a complete example of a simple Clikt program: class Hello : CliktCommand() {
val count: Int by option(help="Number of greetings").int().default(1)
val name: String by option(help="The person to greet").prompt("Your name")
override fun run() {
repeat(count) {
echo("Hello $name!")
}
}
}
fun main(args: Array<String>) = Hello().main(args) And here's what it looks like when run:
The help page is generated for you:
Errors are also taken care of:
DocumentationThe full documentation can be found on the website. There are also a number of sample applications. You can run
them with the included InstallationClikt is distributed through Maven Central. dependencies {
implementation("com.github.ajalt.clikt:clikt:3.5.0")
}
If you're using Maven instead of Gradle, use |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论