There are numerous online examples that use Groovy‘s baked-in Apache Commons CLI based command-line parsing support. These examples include Groovy Command Line Options, Chris Mahns‘s Groovy Script: ...
For most Groovy scripts I use, I simply run the script from its Groovy source code as-is and allow the compilation to take place implicitly. However, it can be helpful at times to use groovyc to ...