How to capture arguments passed to a Groovy script?
Sorry about asking the question. I just figured it out:
println args[0]
println args[1]
println args[2]
If you want more advanced parsing than just getting the arguments you can use the Groovy CliBuilder to help you. It helps you with commandline flags, optional arguments and printing the usage instruction.
Checkout CliBuilder's Javadoc or MrHakis post about it.