examples/groovy/cli.groovy

println(args.size())

for (i = 0; i < args.size(); i++) {
    println(i + ' ' + args[i])
}

Run as groovy cli.groovy hello world "hello world" to see how this works.