Using Groovy CliBuilder, ideally I would like to have an cmd-line as follows:
./MyProgram.groovy CommandName -arg1 -arg2 -arg3
Is is possible to parse pull out the CommandName as an argument using CliBuilder?
Using Groovy CliBuilder, ideally I would like to have an cmd-line as follows:
./MyProgram.groovy CommandName -arg1 -arg2 -arg3
Is is possible to parse pull out the CommandName as an argument using CliBuilder?
You can do that if you set the property
stopAtNonOption
to false so that the parsing does not stop inCommandName
. Then you can get the command fromCliBuilder
options. A tiny example below: