I'm using Groovy's CliBuilder to parse command line arguments and generate a usage message when the command line is incorrect. As part of the usage message, I'd like to be able to print the actual name of the program used (since the version number changes with each build). How can I get the name of the program used?
I'd love to be able to do something like:
def cli = new CliBuilder(usage: "java -jar ${this.name} -db DBCONNECTIONFILE")
but all I seem to be able to obtain are the arguments that come after the program name.
Perhaps I can get it from the pom, but I don't understand how I can grab that from the pom file short of reading in and parsing the pom.