Skip to content

Using CMD arguments in jask

Julius Paffrath edited this page Dec 8, 2016 · 4 revisions

When a jask file is interpreted like this:

java -jar jask.jar arg1 arg2

the name and the arguments arg1 and arg2 are stored in a list variable called _ENV.

You can use the _ENV list in your code like this:

store listGet(_ENV:0) in name  
store listGet(_ENV:1) in firstArg

printLine("The calling name is ":name)
printLine("The first argument is ":firstArg)

As every list in jask, the _ENV list is mutable so be careful overriding its content!