title: How to capture arguments passed to a Groovy script?
body: <p>I am just starting out with Groovy.   I couldn't find any examples anywhere of how to handle arguments to a Groovy script and so I hacked this method myself.   There must be a better way of doing this?  If so, I am looking for this better way, since I am probably overlooking the obvious.</p>
  
  <pre><code>import groovy.lang.Binding;
  Binding binding = new Binding();
  int x = 1
  for (a in this.args) {
    println("arg$x: " + a)
    binding.setProperty("arg$x", a);
    x=x+1
  }
  println binding.getProperty("arg1")
  println binding.getProperty("arg2")
  println binding.getProperty("arg3")
  </code></pre>