Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
The picocli community is pleased to announce picocli 4.7.6.
This release includes bugfixes and enhancements.
Many thanks to the picocli community for raising these issues and providing the pull requests to address them!
This is the eighty-fifth public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
PropertiesDefaultProvider
now tries to load properties from the classpath if the file cannot be found in the user.home directory.
PropertiesDefaultProvider
should try to load properties from classpath (last). Thanks to Lumír Návrat for the pull request....
vararg instead of array parameter to match overridden method signature. Thanks to Michael Vorburger for the pull request.defaultValue
should not be applied in addition to user-specified value for options with a custom IParameterConsumer
. Thanks to Staffan Arvidsson McShane for raising this.Example.jar
as ConfigurationPath
cannot be null
anymore. Thanks to llzen44 for the pull request.Optional<T>
arguments with initial value. Thanks to hq6 for raising this.@Option
-annotated setter method not invoked with default value when used in mixin for both command and subcommand. Thanks to Zhonghao Wang for raising this.boolean
options should not be ignored. Thanks to Sven Kammerer for raising this.TruthSelfEquals
warningsParseResult
passed to IExecutionExceptionHandler
is the top-level parse result, not the parse result of the subcommand that failed. Thanks to Abel Salgado Romero for raising this.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.5.
This release includes bugfixes and enhancements.
Many thanks to the picocli community for raising these issues and providing the pull requests to address them!
This is the eighty-forth public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
echo=false
for interactive
options and positional parameters. Thanks to szzsolt for raising this.picocli.shell.jline3.PicoCommand
. Thanks to clebertsuconic for the pull request.exclusive=false
and multiplicity=1
should require at least one option; fix regression and refine solution introduced in [#1848][#2030]. Thanks to Utkarsh Mittal for raising this.graalvm-native-image-plugin
. Thanks to Bhavik Patel for the pull request.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.4.
This release includes bugfixes and enhancements.
Many thanks to the picocli community for raising these issues and providing the pull requests to address them!
This is the eighty-third public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
See fixed items below.
I cheated on the semantic versioning in this release: a public setter method was added in a class in the picocli.shell.jline3
module. In spite of that, the version number went from 4.7.3 to 4.7.4 (not 4.8.0). My apologies.
picocli.shell.jline3.PicocliCommands
. Thanks to Irina Leontyuk for raising this.java.nio.charset.UnsupportedCharsetException: cp0
on windows, and fall back to the default charset if the charset provided by System property sun.stdout.encoding
is invalid. Thanks to
Bartosz Spyrko-Smietanko for the pull request.ArgGroup
becoming optional when combined with DefaultValueProvider
. Thanks to Ruud Senden and Mike Snowden for the pull request.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.3.
This release includes bugfixes and enhancements.
This is the eighty-second public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
Fixed a regression introduced in picocli 4.7.2.
Multi-value options whose fallbackValue
is set to CommandLine.Option.NULL_VALUE
, may see a NullPointerException
if the option is specified on the command line without a parameter but with a =
attached, like --option=
.
Also, this release fixes broken links in the Javadoc.
NOTE: A minor issue with this release is that the version string in the info.picocli.CommandLine.VERSION
field is incorrectly set to 4.7.3-SNAPSHOT
(should have been 4.7.3
).
No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.2.
This release includes bugfixes and enhancements.
This is the eighty-first public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
fallbackValue=Option.NULL_VALUE
did not work for Collection
or array options.isJansiConsoleInstalled
performance issue.paramLabel
string auto-generated from Kotlin internal
methods which have mangled names with embedded "$".fallbackValue=Option.NULL_VALUE
did not work for Collection
or array options. Thanks to Jiri Daněk for raising this.isJansiConsoleInstalled
performance issue. Thanks to ChrisTrenkamp for the pull request.paramLabel
string auto-generated from Kotlin internal
methods which have mangled names with embedded "$". Thanks to Ken Yee for raising this.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.1.
This release includes bugfixes and enhancements.
This is the eightieth public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
picocli-groovy
module should not declare org.codehaus.groovy:groovy-all
as dependency. Thanks to Mattias Andersson and Michael Kutz for raising this, and to Paul King for the analysis.CommandLine.Interpreter.applyValueToSingleValuedField
. Thanks to Jiehong for the pull request.StringIndexOutOfBoundsException
in usage help when command has many (and long) aliases. Thanks to Martin for raising this.fallbackValue
to vararg multi-value options, not just single-value options. Thanks to Andreas Sewe for raising this.ManPageGeneratorTest
. Thanks to Mike Snowden for the pull request.System.exit
usage. Thanks to Tadaya Tsuyukubo for the pull request.picocli-codegen/README.adoc
. Thanks to Seyyed Emad Razavi for the pull request.picocli-annotation-processing-tests
failures on Java 16+: rewrite tests to avoid Google compiler-test
API that internally uses com.sun.tools.javac.util.Context
.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.7.0.
This release includes bugfixes and enhancements.
A potentially breaking change is that the parser now treats char[]
as a single-value type.
From this release, applications can programmatically set the trace level, and use tracing in custom components.
Applications can improve startup time by setting system property picocli.disable.closures
to true
to disable support for closures in annotations.
Many more fixes and enhancements, see the sections below for more details.
This is the seventy-ninth public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
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;
}
}
}
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 namesCommandLine::setAllowSubcommandsAsOptionParameters
allows options to consume subcommand namesWhen 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.
By default, the synopsis displays options in alphabetical order.
Picocli 4.7.0 introduces 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)
char[]
optionsPrior to 4.7, the picocli parser treated options and positional parameters with type char[]
as array (multi-value) options, except for interactive options. However, it is more intuitive to treat all char[]
options as single-value options, similar to String
options.
For end users, this means that existing applications that use non-interactive char[]
options will no longer allow multiple characters to be specified separately on the command line. That is, input like -c A -c B -c C
will be rejected and the user needs to specify -c ABC
instead.
Applications that want to preserve the previous behaviour will need to change their code to use java.lang.Character[]
instead of char[]
.
picocli-codegen
artifact is now an explicitly declared named JPMS module with a module-info.class
.picocli-groovy
artifact is now an explicitly declared named JPMS module with a module-info.class
.picocli-shell-jline2
is now an explicitly declared named JPMS module with a module-info.class
.picocli-shell-jline3
is now an explicitly declared named JPMS module with a module-info.class
.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
.picocli-spring-boot-starter
JPMS module name to info.picocli.spring.boot
from info.picocli.spring
.requires static java.sql
to picocli module-info
.TraceLevel
. Thanks to ekinano for raising this.requiredOptionMarker
should not be displayed on ArgGroup
options. Thanks to Ahmed El Khalifa for the pull request.PicocliSpringFactory
to allow custom fallback IFactory
. Thanks to Andrew Holland for raising this.OptionSpec.getValue()
and add IScoped
internal API. Thanks to Ruud Senden for the discussion and the pull request.order
.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.char[]
as single-value types (Potentially breaking change). Thanks to Lukáš Petrovický for the pull request with the test to verify the solution.picocli.disable.closures
to true
to disable support for closures in annotations. Thanks to patric-r for raising this.order
if specified. Thanks to Simon for raising this.order
(if specified). Thanks to Enderaoe for the pull request with unit tests.Help
command description. Thanks to Michael L Heuer for the pull request. Thanks to Garret Wilson for raising this.Option
and Parameters
annotations. Thanks to xehpuk for raising this, and thanks to Adam McElwee for the pull request.multiplicity="0"
are now disallowed at construction time and no longer throw a StackOverflowError
while parsing. Thanks to ARNOLD Somogyi for raising this.getCJKAdjustedLength()
no longer miscalculates for supplementary code points. Thanks to gwalbran for the pull request.posixClusteredShortOptionsAllowed
is set to false.@Command
-annotated method parameters are assigned incorrect indices when contained in a @Command
class that is added as a subcommand to another @Command
class which has scope = CommandLine.ScopeType.INHERIT
. Thanks to Onedy for raising this.CommandSpec
. Thanks to Philippe Charles for raising this.null
as defaultValue
and fallbackValue
.main
from master
. Thanks to Andreas Deininger for the pull request.picocli-codegen
README
. Thanks to Andreas Deininger for the pull request.picocli-examples
in the user manual. Thanks to Markus Elfring for raising this.@Command
-annotated method with int
return value in user manual. Thanks to SinaMobasheri for raising this.picocli-groovy
module now declares groovy-all
as dependency.slf4j
from picocli-spring-boot-starter
.No features were deprecated in this release.
picocli-spring-boot-starter
has been changed to info.picocli.spring.boot
from info.picocli.spring
.picocli-groovy
module now declares groovy-all
as dependency.char[]
as a single-value type.The picocli community is pleased to announce picocli 4.6.3.
This release includes bugfixes and enhancements, as well as documentation and security improvements.
Several improvements to the annotation processor and the generated autocompletion scripts.
Much gratitude to the picocli community for the many pull requests and other contributions!
This is the seventy-eighth public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
main
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
compopt: command not found
on older versions of Bashcompinit
onceDuplicateOptionAnnotationsException
when multiple commands had a subcommand in common and an inherited (scope = ScopeType.INHERIT
) option. Thanks to nemetsSY for raising this.-Averbose=true
no longer incorrectly triggers warning: The following options were not recognized by any processor: '[verbose]'
. Thanks to Lorenz Leutgeb for raising this.UnsupportedCharsetException: cp65001
on Microsoft Windows console when code page is set to UTF-8. Thanks to epuni for raising this.parseArgs
invocations when CommandLine
instance is reused. Thanks to kaushalkumar for raising this.compopt: command not found
on older versions Bash. Thanks to Andres Almiray for raising this.AbstractCommandSpecProcessor#extractTypedMember
. Thanks to Ross Goldberg for raising this.help
command only works on the first argument. Thanks to Patrice Duroux for the pull request.CommandSpec#validateSubcommandName
implementation. Thanks to Ross Goldberg for the pull request.org.junit.Assert.assertThat
deprecation warning; Thanks to Ross Goldberg for the pull request.AbstractCommandSpecProcessor#isSubcommand
; Thanks to Ross Goldberg for the pull request.DefaultFactory#create(Class<T>)
. Thanks to Ross Goldberg for the pull request.TypedMember
constructor. Thanks to Ross Goldberg for the pull request.compinit
once. Thanks to Ben Herweyer for the pull request.System.exit
tests on Java 18.jline-console
in picocli-shell-jline3
. Thanks to kaushalkumar for raising this.No features were deprecated in this release.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.6.2.
This release includes bugfixes and enhancements. Many improvements in the documentation.
Thanks to the many people in the picocli community for raising issues and contributing pull requests to fix issues!
From this release, picocli uses system properties sun.stdout.encoding
and sun.stderr.encoding
when creating the PrintWriters
returned by CommandLine::getOut
and CommandLine::getErr
. When these system properties do not exist, picocli falls back to the default charset (determined by file.encoding
). This addresses an issue on Windows, where the default charset is not the same as the encoding for its console (often the older cp437
codepage on English-language versions of Windows).
Note that these system properties seem to have been introduced in Java 8 (although I cannot find it in the JDK 8 release notes) and may not exist on earlier JVMs or on JVMs other than the Oracle and OpenJDK implementations.
This is the seventy-seventh public release. Picocli follows semantic versioning. Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
@Option
help
attribute; it is useful for custom help options. Thanks to kaushalkumar for raising this.WARNING: tag not found in include file
messages when generating man pages. Thanks to Philip Crotwell for the pull request.completionCandidates
when displaying usage help if ${COMPLETION-CANDIDATES}
is not specified in description. Thanks to Wenhao ZHANG, sustc11810424 and Yining Tang for the pull request.IllegalArgumentException: argument type mismatch
error in method subcommands with inherited mixed-in standard help options. Thanks to Andreas Deininger for raising this.CommandLine
with ArgGroup. Thanks to Yashodhan Ghadge for raising this.DuplicateOptionAnnotationsException
thrown on mixinStandardHelpOptions
for subcommands when parent has scope = INHERIT
by picocli-codegen
annotation processor. Thanks to Philippe Charles for raising this.DuplicateOptionAnnotationsException
when parent has inherited mixed-in help options and the built-in HelpCommand
subcommand. Thanks to Andreas Deininger for raising this.IllegalArgumentException
when parent has no standard help options and scope = INHERIT
, while subcommand does have mixed-in standard help options. Thanks to Andreas Deininger for raising this.CommandSpec.remove(arg)
should also remove the arg from the args
collection in the CommandSpec. Thanks to kaushalkumar for the pull request.sun.stdout.encoding
and sun.stderr.encoding
when creating the PrintWriters
returned by CommandLine::getOut
and CommandLine::getErr
. Thanks to Philippe Charles for the investigation and the pull request..gitattributes
should include HTML files to convert CRLF to LF. Thanks to wenhoujx for pointing this out.execute
method in RunAll
, RunFirst
and RunLast
should not be deprecated. Thanks to Gamal DeWeever for raising this.IParameterPreprocessor
from IParameterConsumer
javadoc. Thanks to Andreas Deininger for the pull request.IParameterConsumer
as n-ary type converter. Thanks to Martin for raising this.converter
, improve text for default values. Thanks to Abhijit Sarkar for raising this.setLongOptionsMaxWidth
to setUsageHelpLongOptionsMaxWidth
in user manual section 'Long Option Column Width'. Thanks to kunlk for raising this.picocli-shell-jline2/README.md
. Thanks to Ahmed Ashour for the pull request.MANIFEST.MF
. Thanks to Fiouz for the pull request.pom.xml
. Thanks to Fiouz for the pull request.No features were deprecated in this release.
The @Option
help
attribute is no longer deprecated from this release; it is useful for custom help options.
This release has no breaking changes.
The picocli community is pleased to announce picocli 4.6.1.
This release fixes a problem (introduced in the 4.6.0 release) with dependency scope in the following sub-modules:
The problem was that these modules contained dependencies that were declared to have implementation
scope instead of api
scope.
However, these were transitive dependencies, and necessary to compile any project that uses the above picocli modules.
In this release, transitive dependencies are declared with api
scope in the above modules.
Special thanks to Sualeh Fatehi, Dejan Stojadinović and Semyon Levin for the quick community feedback, pull request and reviews!
This is the seventy-sixth public release. Picocli follows semantic versioning.
picocli-shell-jline3
. Thanks to Sualeh Fatehi for raising this.picocli-shell-jline3
. Thanks to Dejan Stojadinović for the pull request, and Semyon Levin for the review.picocli-spring-boot-starter
. Thanks to Semyon Levin for raising this.No features were deprecated in this release.
This release has no breaking changes.