All Versions
409
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 1

  • v4.7.0-new Changes

    Tracing API

    From picocli 4.7.0, applications can programmatically set the trace level, and use tracing in custom components.

    In addition to setting system property picocli.trace, applications can now change the trace level via the Tracer::setLevel method. For example:

    CommandLine.tracer().setLevel(CommandLine.TraceLevel.INFO);
    

    The new public method CommandLine.tracer() returns the singleton Tracer object that is used internally by picocli, and can also be used by custom component implementations to do tracing. For example:

    class MyIntConverter implements ITypeConverter<Integer> {
        public Integer convert(String value) {
            try {
                return Integer.parseInt(value);
            } catch (NumberFormatException ex) {
                CommandLine.tracer().info(
                        "Could not convert %s to Integer, returning default value -1", value);
                return -1;
            }
        }
    }
    

    Enable Consuming Option Names or Subcommands

    0️⃣ By default, options that take a parameter do not consume values that match a subcommand name or an option name.

    πŸš€ This release introduces two parser configuration options to change this behaviour:

    • CommandLine::setAllowOptionsAsOptionParameters allows options to consume option names
    • CommandLine::setAllowSubcommandsAsOptionParameters allows options to consume subcommand names

    When set to true, all options in the command (options that take a parameter) can consume values that match option names or subcommand names.

    This means that any option will consume the maximum number of arguments possible for its arity.

    πŸ‘‰ USE WITH CAUTION!

    If an option is defined as arity = "*", this option will consume all remaining command line arguments following this option (until the End-of-options delimiter) as parameters of this option.

    Unsorted Synopsis

    0️⃣ By default, the synopsis displays options in alphabetical order. Picocli 4.7.0 introduced a sortSynopsis = false attribute to let the synopsis display options in the order they are declared in your class, or sorted by their order attribute.

    @Command(sortSynopsis = false)
    
  • v4.7.0-fixes Changes

    • [#1599] API: The picocli-codegen artifact is now an explicitly declared named JPMS module with a module-info.class.
    • [#1611] API: The picocli-groovy artifact is now an explicitly declared named JPMS module with a module-info.class.
    • [#1610] API: The picocli-shell-jline2 is now an explicitly declared named JPMS module with a module-info.class.
    • [#1609] API: The picocli-shell-jline3 is now an explicitly declared named JPMS module with a module-info.class.
    • [#1608] API: The picocli-spring-boot-starter is now an explicitly declared named JPMS module with a module-info.class. NOTE: its module name changed to info.picocli.spring.boot from info.picocli.spring.
    • [#1614] API: Change picocli-spring-boot-starter JPMS module name to info.picocli.spring.boot from info.picocli.spring.
    • [#1600] API: Add requires static java.sql to picocli module-info.
    • πŸ”§ [#1471] API: Provide a programmatic way to configure Picocli's TraceLevel. Thanks to ekinano for raising this.
    • πŸ”§ [#1125] API: Add parser configuration to allow options to consume values that match subcommand names or option names.
    • πŸ‘ [#1396][#1401] API: Support generic types in containers (e.g. List, Map). Thanks to MichaΕ‚ GΓ³rniewski for the pull request.
    • πŸ›  [#1380][#1505] API, bugfix: requiredOptionMarker should not be displayed on ArgGroup options. Thanks to Ahmed El Khalifa for the pull request.
    • [#1563] API: Add constructor to PicocliSpringFactory to allow custom fallback IFactory. Thanks to Andrew Holland for raising this.
    • 0️⃣ [#1571] Enhancement: Variables in values from the default value provider should be interpolated. Thanks to Bas Passon for raising this.
    • [#1574] API: Add annotation API to control whether synopsis should be sorted alphabetically or by explicit order.
    • πŸ‘» [#1708][#1712][#1723] API: The setUsageHelpLongOptionsMaxWidth method no longer throws an exception when an invalid value is specified; instead, the value is ignored and an INFO-level trace message is logged. Thanks to Fabio for the pull request.
    • [#1408] Enhancement: Synopsis should respect order if specified. Thanks to Simon for raising this.
    • βœ… [#964][#1080] Enhancement: ArgGroup synopsis should respect order (if specified). Thanks to Enderaoe for the pull request with unit tests.
    • [#1706][#1710] Enhancement: Subcommands should get missing messages from parent command resource bundle. Thanks to Ruud Senden and Mike Snowden for the pull request.
    • [#899][#1578][#1579] Enhancement: improve built-in Help command description. Thanks to Michael L Heuer for the pull request. Thanks to Garret Wilson for raising this.
    • πŸ‘ [#1713][#1714] Enhancement: Support optional booleans in annotation processor. Thanks to Jan WaΕ› for the pull request.
    • [#1387][#1711] Enhancement: Annotation processor should validate final primitive and String fields with Option and Parameters annotations. Thanks to xehpuk for raising this, and thanks to Adam McElwee for the pull request.
    • 🚚 [#1572] Enhancement: Remove redundant braces in ArgGroup synopsis.
    • 🚚 [#1602] Enhancement: Fix incorrect debug output for add/removeAlias.
    • [#1603] Enhancement: Improve debug tracing information for help requests and command execution.
    • [#1629] Enhancement: Omit empty braces in standard prompt for interactive options without description. Thanks to Andreas Deininger for raising this.
    • πŸ›  [#1680] Bugfix: ArgGroups with multiplicity="0" are now disallowed at construction time and no longer throw a StackOverflowError while parsing. Thanks to ARNOLD Somogyi for raising this.
    • πŸ›  [#1615][#1616] Bugfix: getCJKAdjustedLength() no longer miscalculates for supplementary code points. Thanks to gwalbran for the pull request.
    • πŸ›  [#1575] Bugfix: Synopsis should not cluster boolean options if posixClusteredShortOptionsAllowed is set to false.
    • πŸ›  [#1642] Bugfix: Negatable options should negate explicit values. Thanks to Nat Burns for raising this.
    • πŸ›  [#1696][#1697] Bugfix: ManPageGenerator asciidoc output now correctly shows options in nested ArgGroups. Thanks to Ruud Senden for the pull request.
    • [#1298] DOC: Publish all-in-one javadoc for all picocli modules.
    • βœ… [#812] DOC: Document how to test a picocli spring-boot application.
    • ✏️ [#1596] DOC: fix javadoc typos and incorrect links.
    • πŸ”§ [#1597] DOC: Add examples to Execution Configuration section in user manual.
    • [#1140] DOC: Add subsection Forcing Interactive Input to user manual Interactive Options section. Thanks to smalirizvi for raising this.
    • πŸ”§ [#967] DOC: User manual now shows how to configure null as defaultValue and fallbackValue.
    • 0️⃣ [#1625] DOC: Fix broken links after renaming default branch to main from master. Thanks to Andreas Deininger for the pull request.
    • [#1628][#1630] DOC: Fix broken link in picocli-codegen README. Thanks to Andreas Deininger for the pull request.
    • [#1627] DOC: User guide, chapter 3.2.3. Forcing Interactive Input: code sample: add Kotlin version. Thanks to Andreas Deininger for the pull request.
    • ⚠ [#1650] DOC: User guide, Spring Boot section: add warning about dynamic proxies. Thanks to Ernst PlΓΌss for raising this.
    • [#1677] DOC: Many improvements and corrections to the user manual. Thanks to BjΓΆrn Kautler for the pull request.
    • [#1678] DOC: Change links from http to https, fix broken links. Thanks to Andreas Deininger for the pull request.
    • πŸ— [#1581] BUILD: Fix dependabot config.
    • [#1613] DEP: The picocli-groovy module now declares groovy-all as dependency.
    • 🚚 [#1604] DEP: Remove dependency on slf4j from picocli-spring-boot-starter.
    • [#1607] DEP: Bump actions/setup-java from 2.5.0 to 3
    • [#1646] DEP: Bump actions/setup-java from 3.0.0 to 3.1.0
    • [#1655] DEP: Bump actions/setup-java from 3.1.0 to 3.1.1
    • [#1667] DEP: Bump actions/setup-java from 3.1.1 to 3.2.0
    • [#1674] DEP: Bump actions/setup-java from 3.2.0 to 3.3.0
    • [#1717] DEP: Bump actions/setup-java from 3.3.0 to 3.4.0
    • [#1736] DEP: Bump actions/setup-java from 3.4.0 to 3.4.1
    • [#1624] DEP: Bump actions/upload-artifact from 2.3.1 to 3
    • [#1687] DEP: Bump actions/upload-artifact from 3.0.0 to 3.1.0
    • [#1585] DEP: Bump github/codeql-action from 1.0.30 to 1.1.0
    • [#1593] DEP: Bump github/codeql-action from 1.1.0 to 1.1.2
    • [#1601] DEP: Bump github/codeql-action from 1.1.2 to 1.1.3
    • [#1631] DEP: Bump github/codeql-action from 1.1.3 to 1.1.4
    • [#1636] DEP: Bump github/codeql-action from 1.1.4 to 1.1.5
    • [#1643] DEP: Bump github/codeql-action from 1.1.5 to 2.1.6
    • [#1652] DEP: Bump github/codeql-action from 2.1.6 to 2.1.7
    • [#1654] DEP: Bump github/codeql-action from 2.1.7 to 2.1.8
    • [#1669] DEP: Bump github/codeql-action from 2.1.8 to 2.1.9
    • [#1676] DEP: Bump github/codeql-action from 2.1.9 to 2.1.10
    • [#1682] DEP: Bump github/codeql-action from 2.1.10 to 2.1.11
    • [#1700] DEP: Bump github/codeql-action from 2.1.11 to 2.1.12
    • [#1720] DEP: Bump github/codeql-action from 2.1.12 to 2.1.14
    • [#1728] DEP: Bump github/codeql-action from 2.1.14 to 2.1.15
    • [#1739] DEP: Bump github/codeql-action from 2.1.15 to 2.1.16
    • [#1586] DEP: Bump ossf/scorecard-action from 1.0.2 to 1.0.3
    • [#1594] DEP: Bump ossf/scorecard-action from 1.0.3 to 1.0.4
    • [#1691] DEP: Bump ossf/scorecard-action from 1.0.4 to 1.1.0
    • [#1699] DEP: Bump ossf/scorecard-action from 1.1.0 to 1.1.1
    • πŸ”’ [#1583] DEP: Bump step-security/harden-runner from 1.3.0 to 1.4.0
    • πŸ”’ [#1639] DEP: Bump step-security/harden-runner from 1.4.0 to 1.4.1
    • πŸ”’ [#1666] DEP: Bump step-security/harden-runner from 1.4.1 to 1.4.2
    • πŸ”’ [#1730] DEP: Bump step-security/harden-runner from 1.4.3 to 1.4.4
    • [#1580] DEP: Bump asciidoctor to 2.5.3 from 2.5.2. Thanks to Andreas Deininger for the pull request.
    • [#1688] DEP: Bump asciidoctorj-pdf from 1.6.2 to 2.0.0
    • [#1690] DEP: Bump asciidoctorj-pdf from 2.0.0 to 2.0.2
    • [#1692] DEP: Bump asciidoctorj-pdf from 2.0.2 to 2.0.3
    • [#1694] DEP: Bump asciidoctorj-pdf from 2.0.3 to 2.0.4
    • [#1695] DEP: Bump asciidoctorj-pdf from 2.0.4 to 2.0.6
    • [#1715] DEP: Bump asciidoctorj-pdf from 2.0.6 to 2.0.8
    • [#1722] DEP: Bump asciidoctorj-pdf from 2.0.8 to 2.1.2
    • [#1618] DEP: Bump biz.aQute.bnd.gradle from 6.1.0 to 6.2.0
    • [#1698] DEP: Bump biz.aQute.bnd.gradle from 6.2.0 to 6.3.0
    • [#1703] DEP: Bump biz.aQute.bnd.gradle from 6.3.0 to 6.3.1
    • βœ… [#1582] DEP: Bump groovy-all from 2.4.10 to 2.5.15 // latest version of Groovy that supports Java 5
    • [#1589] DEP: Bump hamcrest-core from 1.3 to 2.2
    • [#1621] DEP: Bump hibernate-validator from 7.0.2.Final to 7.0.3.Final
    • [#1633][#1635] DEP: Bump hibernate-validator from 7.0.3.Final to 7.0.4.Final
    • [#1622] DEP: Bump hibernate-validator-annotation-processor from 7.0.2.Final to 7.0.3.Final
    • [#1634] DEP: Bump hibernate-validator-annotation-processor from 7.0.3.Final to 7.0.4.Final
    • [#1587] DEP: Bump ivy from 2.4.0 to 2.5.0
    • [#1584] DEP: Bump jansi from 2.1.0 to 2.4.0
    • [#1573] DEP: Bump JLine3 version to 3.21.0 from 3.19.0.
    • [#1590] DEP: Bump junit-dep from 4.11 to 4.11.20120805.1225
    • [#1591] DEP: Bump junit from 4.12 to 4.13.2
    • πŸ”Œ [#1649] DEP: Bump kotlin-gradle-plugin from 1.6.10 to 1.6.20
    • [#1648] DEP: Bump kotlin-script-runtime from 1.6.10 to 1.6.20
    • [#1617] DEP: Bump log4j2Version from 2.17.1 to 2.17.2
    • [#1729] DEP: Bump log4j2Version from 2.17.2 to 2.18.0
    • [#1576] DEP: Bump Spring Boot version from 2.5.6 to 2.6.3
    • [#1606] DEP: Bump Spring Boot version from 2.6.3 to 2.6.4
    • [#1641] DEP: Bump Spring Boot version from 2.6.4 to 2.6.5
    • [#1645] DEP: Bump Spring Boot version from 2.6.5 to 2.6.6
    • [#1684] DEP: Bump Spring Boot version from 2.6.7 to 2.6.8
    • [#1686] DEP: Bump Spring Boot version from 2.6.8 to 2.7.0
    • [#1719] DEP: Bump Spring Boot version from 2.7.0 to 2.7.1
    • [#1588] DEP: Bump system-rules from 1.17.1 to 1.19.0
  • v4.7.0-deprecated Changes

    πŸš€ No features were deprecated in this release.

  • v4.7.0-breaking Changes

    • The JPMS module name of picocli-spring-boot-starter has been changed to info.picocli.spring.boot from info.picocli.spring.
    • The picocli-groovy module now declares groovy-all as dependency.
    • Redundant braces are now omitted in ArgGroup synopsis in usage help messages.
  • v4.6.3-new Changes

    0️⃣ Default branch renamed to main

    0️⃣ The default branch has been renamed! master is now named main.

    ⚑️ If you have a local clone, you can update it by running the following commands:

    git branch -m master main
    git fetch origin
    git branch -u origin/main main
    git remote set-head origin -a
    

    Autocompletion script improvements

    • Autocompletion now shows subcommand aliases in the completion candidates
    • Autocompletion now displays completion candidates on exact match
    • πŸ‘ Autocompletion now supports file names containing spaces
    • βœ‚ Remove file name extension and local dir prefix from the command name in generated autocomplete scripts
    • πŸ›  Fix Bash error compopt: command not found on older versions of Bash
    • Autocompletion on ZSH should only call compinit once
  • v4.6.3-fixes Changes

    • πŸ›  [#1440] Bugfix: annotation processor incorrectly failed with DuplicateOptionAnnotationsException when multiple commands had a subcommand in common and an inherited (scope = ScopeType.INHERIT) option. Thanks to nemetsSY for raising this.
    • πŸ›  [#1472] Bugfix: annotation processor option -Averbose=true no longer incorrectly triggers warning: The following options were not recognized by any processor: '[verbose]'. Thanks to Lorenz Leutgeb for raising this.
    • πŸ›  [#1384][#1493] Bugfix: parser now correctly handles ArgGroups with optional positional parameters. Thanks to Matthew Lewis for raising this and to Kurt Kaiser for the pull request.
    • πŸ›  [#1474] Bugfix: Avoid UnsupportedCharsetException: cp65001 on Microsoft Windows console when code page is set to UTF-8. Thanks to epuni for raising this.
    • πŸ›  [#1528][#1529] Bugfix: Allow aliases of a CommandSpec that is already a subcommand to be properly & consistently modified. Thanks to Ross Goldberg for the pull request.
    • πŸ›  [#1466][#1467] Bugfix/Enhancement: Autocomplete now shows subcommand aliases in the completion candidates. Thanks to Ruud Senden for the pull request.
    • πŸ›  [#1468] Bugfix/Enhancement: Autocompletion now displays completion candidates on exact match. Thanks to Ruud Senden for raising this.
    • πŸ›  [#1537][#1541] Bugfix: AbbreviationMatcher now treats aliases of the same object as one match. Thanks to Staffan Arvidsson McShane for raising this and NewbieOrange for the pull request.
    • πŸ›  [#1531] Bugfix: Options defined as annotated methods should reset between parseArgs invocations when CommandLine instance is reused. Thanks to kaushalkumar for raising this.
    • πŸ‘ [#1458][#1473] Enhancement: Autocompletion now supports file names containing spaces. Thanks to zpater345 for raising this and thanks to NewbieOrange for the pull request.
    • 🚚 [#1477] Enhancement: Remove file name extension and local dir prefix from the command name in generated autocomplete scripts. Thanks to Andrea Peruffo for the pull request.
    • [#1464] Enhancement: Fix Bash error compopt: command not found on older versions Bash. Thanks to Andres Almiray for raising this.
    • [#1476] Enhancement: improve error message in AbstractCommandSpecProcessor#extractTypedMember. Thanks to Ross Goldberg for raising this.
    • [#1475] Enhancement: Fix typo in annotation target-type error message. Thanks to Ross Goldberg for the pull request.
    • [#1366][#1370] Enhancement: show in usage help that the built-in help command only works on the first argument. Thanks to Patrice Duroux for the pull request.
    • πŸ’… [#1492] Enhancement: Use EditorConfig to define file formats and coding style; Thanks to Goooler for the pull request.
    • [#1530] Enhancement: Simplified CommandSpec#validateSubcommandName implementation. Thanks to Ross Goldberg for the pull request.
    • πŸ—„ [#1484] Enhancement: Fixed org.junit.Assert.assertThat deprecation warning; Thanks to Ross Goldberg for the pull request.
    • πŸ— [#1485] Enhancement: Fix build warnings; build doc enhancements; Thanks to Ross Goldberg for the pull request.
    • [#1483] Enhancement: Improved AbstractCommandSpecProcessor#isSubcommand; Thanks to Ross Goldberg for the pull request.
    • 0️⃣ [#1499] Enhancement: Improved DefaultFactory#create(Class<T>). Thanks to Ross Goldberg for the pull request.
    • [#1518] Enhancement: Simplified detection of getter & setter in TypedMember constructor. Thanks to Ross Goldberg for the pull request.
    • [#1568] Enhancement: CommandLine cleanup. Thanks to Ross Goldberg for the pull request.
    • [#1526][#1548] Enhancement: Autocompletion on ZSH should only call compinit once. Thanks to Ben Herweyer for the pull request.
    • πŸ“š [#1539] DOC: Various documentation improvements. Thanks to Hamid Nazari for the pull request.
    • 🚚 [#1481] DOC: Removed repeated "whether" typo in JavaDoc; Thanks to Ross Goldberg for the pull request.
    • ⚑️ [#1125][#1538] DOC: Update "Option Names or Subcommands as Option Values" section in user manual; Thanks to Scott Turner for raising this.
    • πŸ“š [#1409][#1463] DOC: add documentation section on using default values in argument groups. Thanks to Ben Kedo for the pull request.
    • βœ… [#1383][#1502] DOC: add tests demonstrating usage of multiple arguments. Thanks to Ben Kedo and lind6 for the pull request.
    • πŸ“š [#1462] DOC, BUILD, DEP: Extend documentation on argument files, fix broken/outdated links, update dependencies. Thanks to Andreas Deininger for the pull request.
    • [#1457] DOC: add caution about arguments in @files with quoted option parameters. Thanks to Andreas Deininger for the pull request.
    • [#1544][#1545] DOC: Add NOTICE file with GPL v2 + CPE license. Thanks to Keith M Swartz for the pull request.
    • πŸ”’ [#1553] SECURITY: Fix code scanning alert - Token-Permissions
    • πŸ”’ [#1554] SECURITY: Fix code scanning alert - Pinned-Dependencies
    • πŸ”’ [#1555] SECURITY: Fix code scanning alert - Create SECURITY.md
    • πŸ”’ [#1556][#1557] SECURITY: Fix code scanning alert - SAST
    • πŸ”’ [#1558] SECURITY: Fix code scanning alert - Pinned-Dependencies in codeql-analysis.yml
    • πŸ”’ [#1559] SECURITY: Fix code scanning alert - Token-Permissions in codeql-analysis.yml
    • πŸ”’ [#1560] SECURITY: Fix code scanning alert - Binary-Artifacts - Validate Gradle Wrapper
    • πŸ”’ [#1561] SECURITY: Fix code scanning alert - Doc/example code uses a broken or risky cryptographic algorithm
    • πŸ— [#1562] BUILD: Rename 'master' branch to 'main'
    • πŸ— [#1491] BUILD: Add build job in CI; Thanks to Goooler for the pull request.
    • ⚑️ [#1482] BUILD: Optimize gradle; Thanks to Goooler for the pull request.
    • πŸš€ [#1461] BUILD: Allow publishing without signing for non-release versions. Thanks to Andreas Deininger for raising this.
    • πŸ— [#1459] BUILD: The nexus-staging Gradle plugin must be applied to the root project, not to subprojects. Thanks to Andreas Deininger for raising this.
    • πŸ— [#1503] BUILD: Fix failing System.exit tests on Java 18.
    • πŸ— [#1504] BUILD: Run tests on Java 6-7 in CI environment, semi-automate testing on Java 5.
    • 🚚 [#1516] DEP: Remove redundant dependency on jline-console in picocli-shell-jline3. Thanks to kaushalkumar for raising this.
    • [#1495] DEP: Bump validation-api from 2.0.0.Final to 2.0.1.Final
    • [#1496] DEP: Bump biz.aQute.bnd.gradle from 5.1.2 to 6.1.0
    • πŸ”Œ [#1494] DEP: Bump kotlin-gradle-plugin from 1.5.31 to 1.6.0
    • [#1497] DEP: Bump badass-jar from 1.1.3 to 1.2.0
    • [#1498] DEP: Bump hibernate-validator from 6.1.2.Final to 7.0.1.Final
    • [#1490] DEP: Bump hibernate-validator-annotation-processor from 6.1.2.Final to 7.0.1.Final
    • [#1489] DEP: Bump log4j-core from 2.13.0 to 2.14.1
    • [#1488] DEP: Bump log4j-api from 2.13.0 to 2.14.1
    • [#1487] DEP: Bump kotlin-script-runtime from 1.5.31 to 1.6.0
    • πŸ”Œ [#1486] DEP: Bump gradle-nexus-staging-plugin from 0.21.0 to 0.30.0
    • [#1500][#1517] DEP: Bump gradle from 7.3 to 7.3.3. Thanks to Ross Goldberg for the pull request.
    • [#1569] DEP: Bump gradle from 7.3.3 to 7.4. Thanks to Ross Goldberg for the pull request.
    • πŸ”Œ [#1515] DEP: Bump kotlin-gradle-plugin from 1.6.0 to 1.6.10
    • [#1512] DEP: Bump kotlin-script-runtime from 1.6.0 to 1.6.10
    • [#1514] DEP: Bump log4j-api from 2.14.1 to 2.17.1
    • [#1513] DEP: Bump log4j-core from 2.14.1 to 2.17.1
    • [#1543] DEP: Bump asciidoctorj-pdf from 1.6.0 to 1.6.2
    • [#1547] DEP: Bump scala-library from 2.13.7 to 2.13.8
    • [#1550] DEP: Bump hibernate-validator from 7.0.1.Final to 7.0.2.Final
    • [#1551] DEP: Bump hibernate-validator-annotation-processor from 7.0.1.Final to 7.0.2.Final
  • v4.6.3-deprecated Changes

    πŸš€ No features were deprecated in this release.

  • v4.6.3-breaking Changes

    πŸš€ This release has no breaking changes.