File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ // @file:DependsOn("com.github.ajalt:clikt:2.7.1")
2+ @file:DependsOn(" com.github.ajalt.clikt:clikt-jvm:3.0.1" )
3+
4+
5+ import com.github.ajalt.clikt.core.CliktCommand
6+ import com.github.ajalt.clikt.parameters.options.default
7+ import com.github.ajalt.clikt.parameters.options.option
8+ import com.github.ajalt.clikt.parameters.options.prompt
9+ import com.github.ajalt.clikt.parameters.types.int
10+
11+ class Hello : CliktCommand () {
12+ val count: Int by option(help= " Number of greetings" ).int().default(1 )
13+ val name: String by option(help= " The person to greet" ).prompt(" Your name" )
14+
15+ override fun run () {
16+ repeat(count) {
17+ echo(" Hello $name !" )
18+ }
19+ }
20+ }
21+ // @file:KotlinOpts("-J-Xmx5g")
22+ // @file:KotlinOpts("-J-server")
23+ // @file:CompilerOpts("-jvm-target 1.8")
24+
25+ Hello ().main(args)
26+ // Startup.main(args)
You can’t perform that action at this time.
0 commit comments