File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,27 @@ import com.github.ajalt.clikt.parameters.arguments.argument
8
8
import com.github.ajalt.clikt.parameters.arguments.help
9
9
import com.github.ajalt.clikt.parameters.arguments.multiple
10
10
import com.github.ajalt.clikt.parameters.options.flag
11
+ import com.github.ajalt.clikt.parameters.options.help
11
12
import com.github.ajalt.clikt.parameters.options.option
12
13
import processing.app.ui.Start
13
14
14
15
class Processing : SuspendingCliktCommand (" processing" ){
16
+ val version by option(" -v" ," --version" )
17
+ .flag()
18
+ .help(" Print version information" )
19
+
15
20
val sketches by argument()
16
21
.multiple(default = emptyList())
17
22
.help(" Sketches to open" )
18
23
19
24
override fun help (context : Context ) = " Start the Processing IDE"
20
25
override val invokeWithoutSubcommand = true
21
26
override suspend fun run () {
27
+ if (version){
28
+ println (" processing-${Base .getVersionName()} -${Base .getRevision()} " )
29
+ return
30
+ }
31
+
22
32
val subcommand = currentContext.invokedSubcommand
23
33
if (subcommand == null ) {
24
34
Start .main(sketches.toTypedArray())
You can’t perform that action at this time.
0 commit comments