Skip to content

Commit 036d01e

Browse files
committed
Added version option
1 parent 30fd531 commit 036d01e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/processing/app/Processing.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@ import com.github.ajalt.clikt.parameters.arguments.argument
88
import com.github.ajalt.clikt.parameters.arguments.help
99
import com.github.ajalt.clikt.parameters.arguments.multiple
1010
import com.github.ajalt.clikt.parameters.options.flag
11+
import com.github.ajalt.clikt.parameters.options.help
1112
import com.github.ajalt.clikt.parameters.options.option
1213
import processing.app.ui.Start
1314

1415
class Processing: SuspendingCliktCommand("processing"){
16+
val version by option("-v","--version")
17+
.flag()
18+
.help("Print version information")
19+
1520
val sketches by argument()
1621
.multiple(default = emptyList())
1722
.help("Sketches to open")
1823

1924
override fun help(context: Context) = "Start the Processing IDE"
2025
override val invokeWithoutSubcommand = true
2126
override suspend fun run() {
27+
if(version){
28+
println("processing-${Base.getVersionName()}-${Base.getRevision()}")
29+
return
30+
}
31+
2232
val subcommand = currentContext.invokedSubcommand
2333
if (subcommand == null) {
2434
Start.main(sketches.toTypedArray())

0 commit comments

Comments
 (0)