diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bd6b6bdb..c315e0848 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ jobs: continue-on-error: ${{ matrix.os == 'macos-latest' || matrix.java-version == '9' || matrix.java-version == '10' || matrix.java-version == '12' || matrix.java-version == '13' || matrix.java-version == '14' || matrix.java-version == '15' || matrix.java-version == '16' || matrix.java-version == '19' }} steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v1 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v1 with: egress-policy: audit - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v2 - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1 @@ -130,12 +130,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v1 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v1 with: egress-policy: audit - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v2 - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 672aba6a6..46802ec3f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -49,12 +49,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v1 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v1 with: egress-policy: audit - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 322e72ec4..ea2445aa8 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -31,7 +31,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v2.4.0 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v2.4.0 with: persist-credentials: false diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 70f4a5503..2979b0b29 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -27,6 +27,7 @@ Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96). * [#2102][#2107] Enhancement: `PropertiesDefaultProvider` should try to load properties from classpath (last). Thanks to [Lumír Návrat](https://github.com/rimuln) for the pull request. * [#2058] Bugfix: `defaultValue` should not be applied in addition to user-specified value for options with a custom `IParameterConsumer`. Thanks to [Staffan Arvidsson McShane](https://github.com/StaffanArvidsson) for raising this. +* [#2148] Bugfix: Fix NPE in jline3 `Example.jar` as `ConfigurationPath` cannot be `null` anymore. Thanks to [llzen44](https://github.com/llzen44) for the pull request. * [#2047] DEP: Bump andymckay/append-gist-action from 1fbfbbce708a39bd45846f0955ed5521f2099c6d to 6e8d64427fe47cbacf4ab6b890411f1d67c07f3e * [#2091] DEP: Bump actions/checkout from 3.5.2 to 3.6.0 * [#2108] DEP: Bump actions/checkout from 3.6.0 to 4.0.0 diff --git a/build.gradle b/build.gradle index 2043c1f6a..53c55dc80 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { classpath "org.asciidoctor:asciidoctor-gradle-jvm:$asciidoctorGradlePluginVersion" classpath 'org.asciidoctor:asciidoctorj-pdf:2.3.9' classpath "org.beryx:badass-jar:2.0.0" - classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0' + classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0' classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0" } } diff --git a/dependencies.gradle b/dependencies.gradle index c95c1f685..8545d630f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -19,12 +19,12 @@ ext { hamcrestCoreVersion = "2.2" ivyVersion = "2.5.2" jacocoVersion = "0.8.2" - jansiVersion = "2.4.0" + jansiVersion = "2.4.1" jline2Version = "2.14.6" jline3Version = "3.24.1" junitDepVersion = "4.11" junitVersion = "4.13.2" - log4j2Version = "2.20.0" + log4j2Version = "2.21.1" springBootVersion = "3.1.2" // Spring Boot 3.0 requires Java 17 as a minimum version systemRulesVersion = "1.19.0" systemLambdaVersion = '1.2.1' diff --git a/docs/A-Whirlwind-Tour-of-Picocli.html b/docs/A-Whirlwind-Tour-of-Picocli.html index 8cb5f1d99..4f8ea7977 100644 --- a/docs/A-Whirlwind-Tour-of-Picocli.html +++ b/docs/A-Whirlwind-Tour-of-Picocli.html @@ -1564,81 +1564,81 @@ }); }); - - - + + + diff --git a/docs/announcing-picocli-1.0.html b/docs/announcing-picocli-1.0.html index 1266d35b6..7f96c8a4b 100644 --- a/docs/announcing-picocli-1.0.html +++ b/docs/announcing-picocli-1.0.html @@ -526,81 +526,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/autocomplete.html b/docs/autocomplete.html index 2bff6ac2a..b6cfab371 100644 --- a/docs/autocomplete.html +++ b/docs/autocomplete.html @@ -1563,81 +1563,81 @@ }); }); - - - + + + diff --git a/docs/build-great-native-cli-apps-in-java-with-graalvm-and-picocli.html b/docs/build-great-native-cli-apps-in-java-with-graalvm-and-picocli.html index bbeb66aed..0234a366d 100644 --- a/docs/build-great-native-cli-apps-in-java-with-graalvm-and-picocli.html +++ b/docs/build-great-native-cli-apps-in-java-with-graalvm-and-picocli.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/feedback.html b/docs/feedback.html index e25ceb34a..8133b0290 100644 --- a/docs/feedback.html +++ b/docs/feedback.html @@ -435,81 +435,81 @@ #footer-text{color:rgba(0,0,0,.6);font-size:.9em}} @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} - - - + + + diff --git a/docs/groovy-2.5-clibuilder-renewal-part1.html b/docs/groovy-2.5-clibuilder-renewal-part1.html index cced44018..c4d151911 100644 --- a/docs/groovy-2.5-clibuilder-renewal-part1.html +++ b/docs/groovy-2.5-clibuilder-renewal-part1.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/groovy-2.5-clibuilder-renewal-part2.html b/docs/groovy-2.5-clibuilder-renewal-part2.html index 9f13200f9..51ef0012d 100644 --- a/docs/groovy-2.5-clibuilder-renewal-part2.html +++ b/docs/groovy-2.5-clibuilder-renewal-part2.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/groovy-2.5-clibuilder-renewal.html b/docs/groovy-2.5-clibuilder-renewal.html index 70bde93cf..1db853ad7 100644 --- a/docs/groovy-2.5-clibuilder-renewal.html +++ b/docs/groovy-2.5-clibuilder-renewal.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/index.html b/docs/index.html index bb6d1e11e..52f8566cd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1709,81 +1709,81 @@ }); }); - - - + + + diff --git a/docs/man/index.html b/docs/man/index.html index 2985c4513..388728dda 100644 --- a/docs/man/index.html +++ b/docs/man/index.html @@ -435,81 +435,81 @@ #footer-text{color:rgba(0,0,0,.6);font-size:.9em}} @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} - - - + + + diff --git a/docs/migrating-from-commons-cli.html b/docs/migrating-from-commons-cli.html index 374c4cc1f..377cc82bc 100644 --- a/docs/migrating-from-commons-cli.html +++ b/docs/migrating-from-commons-cli.html @@ -526,81 +526,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/picocli-2.0-do-more-with-less.html b/docs/picocli-2.0-do-more-with-less.html index 9e0a4cfc1..5b6e41a80 100644 --- a/docs/picocli-2.0-do-more-with-less.html +++ b/docs/picocli-2.0-do-more-with-less.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/picocli-2.0-groovy-scripts-on-steroids.html b/docs/picocli-2.0-groovy-scripts-on-steroids.html index 885b82171..2fd872576 100644 --- a/docs/picocli-2.0-groovy-scripts-on-steroids.html +++ b/docs/picocli-2.0-groovy-scripts-on-steroids.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/picocli-on-graalvm.html b/docs/picocli-on-graalvm.html index f7eace880..396002696 100644 --- a/docs/picocli-on-graalvm.html +++ b/docs/picocli-on-graalvm.html @@ -436,81 +436,81 @@ @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} - - - + + + diff --git a/docs/picocli-programmatic-api.html b/docs/picocli-programmatic-api.html index c0b9d4dfd..f610d038a 100644 --- a/docs/picocli-programmatic-api.html +++ b/docs/picocli-programmatic-api.html @@ -436,81 +436,81 @@ @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} - - - + + + diff --git a/docs/quick-guide.html b/docs/quick-guide.html index aebdf5f3d..6e8e9a86a 100644 --- a/docs/quick-guide.html +++ b/docs/quick-guide.html @@ -1709,81 +1709,81 @@ }); }); - - - + + + diff --git a/docs/zh/picocli-2.0-do-more-with-less.html b/docs/zh/picocli-2.0-do-more-with-less.html index 30cf528cb..85bdb57aa 100644 --- a/docs/zh/picocli-2.0-do-more-with-less.html +++ b/docs/zh/picocli-2.0-do-more-with-less.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/docs/zh/picocli-2.0-groovy-scripts-on-steroids.html b/docs/zh/picocli-2.0-groovy-scripts-on-steroids.html index ffb7ba4d3..a7703d3f8 100644 --- a/docs/zh/picocli-2.0-groovy-scripts-on-steroids.html +++ b/docs/zh/picocli-2.0-groovy-scripts-on-steroids.html @@ -525,81 +525,81 @@ .CodeRay .change .change{color:#66f} .CodeRay .head .head{color:#f4f} - - - + + + diff --git a/picocli-shell-jline3/README.md b/picocli-shell-jline3/README.md index f108e61c2..e17564bf0 100644 --- a/picocli-shell-jline3/README.md +++ b/picocli-shell-jline3/README.md @@ -69,7 +69,7 @@ JLine [Wiki](https://github.com/jline/jline3/wiki) and some more [Demos](https:/ ## Example -### Maven +### Maven ```xml @@ -93,6 +93,7 @@ See examples for older versions on the [wiki](https://github.com/remkop/picocli/ package picocli.shell.jline3.example; import org.fusesource.jansi.AnsiConsole; +import org.jline.builtins.ConfigurationPath; import org.jline.console.SystemRegistry; import org.jline.console.impl.Builtins; import org.jline.console.impl.SystemRegistryImpl; @@ -226,7 +227,7 @@ public class Example { try { Supplier workDir = () -> Paths.get(System.getProperty("user.dir")); // set up JLine built-in commands - Builtins builtins = new Builtins(workDir, null, null); + Builtins builtins = new Builtins(workDir, new ConfigurationPath(workDir.get(), workDir.get()), null); builtins.rename(Builtins.Command.TTOP, "top"); builtins.alias("zle", "widget"); builtins.alias("bindkey", "keymap"); diff --git a/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java b/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java index 7d3ff6d44..fb1917bc3 100644 --- a/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java +++ b/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java @@ -1,6 +1,7 @@ package picocli.shell.jline3.example; import org.fusesource.jansi.AnsiConsole; +import org.jline.builtins.ConfigurationPath; import org.jline.console.SystemRegistry; import org.jline.console.impl.Builtins; import org.jline.console.impl.SystemRegistryImpl; @@ -134,7 +135,7 @@ public static void main(String[] args) { try { Supplier workDir = () -> Paths.get(System.getProperty("user.dir")); // set up JLine built-in commands - Builtins builtins = new Builtins(workDir, null, null); + Builtins builtins = new Builtins(workDir, new ConfigurationPath(workDir.get(), workDir.get()), null); builtins.rename(Builtins.Command.TTOP, "top"); builtins.alias("zle", "widget"); builtins.alias("bindkey", "keymap"); diff --git a/src/main/java/picocli/AutoComplete.java b/src/main/java/picocli/AutoComplete.java index b0549064f..80186c879 100644 --- a/src/main/java/picocli/AutoComplete.java +++ b/src/main/java/picocli/AutoComplete.java @@ -785,7 +785,7 @@ private static String generatePositionalParamsCases(List po int max = param.index().max(); if (param.completionCandidates() != null) { buff.append(format("%s %s (( currIndex >= %d && currIndex <= %d )); then\n", indent, ifOrElif, min, max)); - buff.append(format("%s positionals=$( compReplyArray \"${%s_pos_param_args[@]}\" )\n", indent, paramName, currWord)); + buff.append(format("%s positionals=$( compReplyArray \"${%s_pos_param_args[@]}\" )\n", indent, paramName)); } else if (type.equals(File.class) || "java.nio.file.Path".equals(type.getName())) { buff.append(format("%s %s (( currIndex >= %d && currIndex <= %d )); then\n", indent, ifOrElif, min, max)); buff.append(format("%s local IFS=$'\\n'\n", indent)); @@ -829,7 +829,7 @@ private static String generateOptionsCases(List argOptionFields, Str if (option.completionCandidates() != null) { buff.append(format("%s %s)\n", indent, concat("|", option.names()))); // " -u|--timeUnit)\n" buff.append(format("%s local IFS=$'\\n'\n", indent)); - buff.append(format("%s COMPREPLY=( $( compReplyArray \"${%s_option_args[@]}\" ) )\n", indent, bashify(option.paramLabel()), currWord)); + buff.append(format("%s COMPREPLY=( $( compReplyArray \"${%s_option_args[@]}\" ) )\n", indent, bashify(option.paramLabel()))); buff.append(format("%s return $?\n", indent)); buff.append(format("%s ;;\n", indent)); } else if (type.equals(File.class) || "java.nio.file.Path".equals(type.getName())) { diff --git a/src/main/java/picocli/CommandLine.java b/src/main/java/picocli/CommandLine.java index d51f83492..88d7fe1bd 100644 --- a/src/main/java/picocli/CommandLine.java +++ b/src/main/java/picocli/CommandLine.java @@ -3664,7 +3664,7 @@ private static class NoCompletionCandidates implements Iterable { public enum ScopeType { /** The element only exists in the current command. */ LOCAL, - /** The element exists in the command where the element is defined and all descendents (subcommands, sub-subcommands, etc.). */ + /** The element exists in the command where the element is defined and all descendants (subcommands, sub-subcommands, etc.). */ INHERIT, } /** @@ -4944,7 +4944,7 @@ enum Target { String multiplicity() default "0..1"; /** Determines whether picocli should validate the rules of this group ({@code true} by default). * For a mutually exclusive group validation means verifying that no more than one elements of the group is specified on the command line; - * for a co-ocurring group validation means verifying that all elements of the group are specified on the command line. + * for a co-occurring group validation means verifying that all elements of the group are specified on the command line. * Set {@link #validate() validate = false} for groups whose purpose is only to customize the usage help message. * @see #multiplicity() * @see #heading() */ @@ -7330,7 +7330,7 @@ public CommandSpec aliases(String... aliases) { * @see Command#scope() * @since 4.6 */ public boolean inherited() { return inherited; } - /** Returns the scope of this argument; it it local, or inherited (it applies to this command as well as all sub- and sub-subcommands). + /** Returns the scope of this argument; is it local, or inherited (it applies to this command as well as all sub- and sub-subcommands). * @return whether this argument applies to all descendent subcommands of the command where it is defined * @since 4.6 */ public ScopeType scopeType() { return scopeType == null ? ScopeType.LOCAL : scopeType; } @@ -9031,7 +9031,7 @@ private String[] expandVariables(String[] desc) { * Returns a regular expression to split option parameter for usage information. * @see Option#splitSynopsisLabel() * @since 4.3 - * */ + */ public String splitRegexSynopsisLabel() { return interpolate(splitRegexSynopsisLabel); } /** Returns whether this option should be excluded from the usage message. @@ -9091,7 +9091,7 @@ public String mapFallbackValue() { * the option will be reset to before parsing (regardless of whether a default value exists), * to clear values that would otherwise remain from parsing previous input. */ public Object initialValue() { - // not not initialize if already CACHED, or UNAVAILABLE, or if annotatedElement==null + // Do not initialize if already CACHED, or UNAVAILABLE, or if annotatedElement==null if (initialValueState == InitialValueState.POSTPONED && annotatedElement != null) { try { initialValue = annotatedElement.getter().get(); @@ -9179,7 +9179,7 @@ private String defaultValueFromProvider() { /** Returns the binding {@link IScope} that determines on which object to set the value (or from which object to get the value) of this argument. */ public IScope scope() { return scope; } - /** Returns the scope of this argument; it it local, or inherited (it applies to this command as well as all sub- and sub-subcommands). + /** Returns the scope of this argument; is it local, or inherited (it applies to this command as well as all sub- and sub-subcommands). * @return whether this argument applies to all descendent subcommands of the command where it is defined * @since 4.3 */ public ScopeType scopeType() { return scopeType; } @@ -10456,7 +10456,7 @@ public static class ArgGroupSpec implements IOrdered { /** Returns whether picocli should validate the rules of this group: * for a mutually exclusive group this means that no more than one arguments in the group is specified on the command line; - * for a co-ocurring group this means that all arguments in the group are specified on the command line. + * for a co-occurring group this means that all arguments in the group are specified on the command line. * {@code true} by default. * @see ArgGroup#validate() */ public boolean validate() { return validate; } @@ -10931,13 +10931,13 @@ public Builder updateArgGroupAttributes(ArgGroup group) { /** Returns whether picocli should validate the rules of this group: * for a mutually exclusive group this means that no more than one arguments in the group is specified on the command line; - * for a co-ocurring group this means that all arguments in the group are specified on the command line. + * for a co-occurring group this means that all arguments in the group are specified on the command line. * {@code true} by default. * @see ArgGroup#validate() */ public boolean validate() { return validate; } /** Sets whether picocli should validate the rules of this group: * for a mutually exclusive group this means that no more than one arguments in the group is specified on the command line; - * for a co-ocurring group this means that all arguments in the group are specified on the command line. + * for a co-occurring group this means that all arguments in the group are specified on the command line. * {@code true} by default. * @see ArgGroup#validate() */ public Builder validate(boolean newValue) { validate = newValue; return this; }