diff --git a/groovy-commons-cli-1.3.patch b/groovy-commons-cli-1.3.patch index 0ef65b596bf5bd67df1ea975f6131a8098604861..5ccb758b1316a9c083c256144fc35ddacf3df46b 100644 --- a/groovy-commons-cli-1.3.patch +++ b/groovy-commons-cli-1.3.patch @@ -486,6 +486,29 @@ index fd9765c..db29526 100644 grapeHelp = { int spacesLen = commands.keySet().max {it.length()}.length() + 3 +@@ -326,10 +326,18 @@ if (cmd.hasOption('v')) { + return + } + +- +-cmd.getOptionValues('D')?.each {String prop -> +- def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk +- System.setProperty(k, v ?: "") ++if (cmd.hasOption('D')) { ++ cmd.getOptionValues('D')?.each {String prop -> ++ while (prop.startsWith("=")) { ++ prop = prop.substring(1, prop.length()); ++ } ++ def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk ++ if (k.isEmpty() || v.isEmpty()) { ++ println "one system property's name or value is emply, skip." ++ } else { ++ System.setProperty(k, v ?: "") ++ } ++ } + } + + String[] arg = cmd.args diff --git a/src/test/groovy/util/CliBuilderTest.groovy b/src/test/groovy/util/CliBuilderTest.groovy index cbd7bd1..d67de50 100644 --- a/src/test/groovy/util/CliBuilderTest.groovy diff --git a/groovy18.spec b/groovy18.spec index 44274ace2d059d13efe8cc691f67504e12050413..cc1aa1817a78cac947a378ae419e25212b2cc577 100644 --- a/groovy18.spec +++ b/groovy18.spec @@ -2,7 +2,7 @@ %global archiver 1_8_9 Name: groovy18 Version: 1.8.9 -Release: 3 +Release: 4 Summary: Dynamic language for the Java Platform License: ASL 2.0 and BSD and EPL-1.0 and Public Domain and CPL-1.0 URL: http://groovy-lang.org @@ -122,6 +122,9 @@ install -p -m644 %{SOURCE2} \ %license LICENSE.txt LICENSE-2.0.txt NOTICE.txt cpl-v10.txt epl-v10.txt %changelog +* Mon Mar 11 2024 Ge Wang - 1.8.9-4 +- Add command line parser separator recogonition + * Mon Feb 26 2024 xu_ping <707078654@qq.com> - 1.8.9-3 - fix help information is consistent due to the singularity of the class method.