diff --git a/build.gradle b/build.gradle index b9b3a30..9d4711f 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: "groovy" apply plugin: "maven" group = "com.jdbernard" -version = "4.1" +version = "4.2" repositories { mavenLocal() diff --git a/src/main/groovy/com/jdbernard/util/LightOptionParser.groovy b/src/main/groovy/com/jdbernard/util/LightOptionParser.groovy index 9dec682..2d0b211 100644 --- a/src/main/groovy/com/jdbernard/util/LightOptionParser.groovy +++ b/src/main/groovy/com/jdbernard/util/LightOptionParser.groovy @@ -170,12 +170,13 @@ public class LightOptionParser { else { if (!returnOpts.containsKey(optName)) returnOpts[optName] = [] - returnOpts[optName] += retVal - if (optDef.longName) { - if (!returnOpts.containsKey(optDef.longName)) - returnOpts[optDef.longName] = [] - returnOpts[optDef.longName] += retVal } } } + if (optDef.arguments == 1) returnOpts[optName] += retVal + else returnOpts[optName] << retVal + + + if (optDef.longName) + returnOpts[optDef.longName] = returnOpts[optName] } } /// This was not as option, it is an unclaomed argument. else { returnOpts.args << args[i]; i++ } }