Skip to content

Commit

Permalink
[#1102] DOC: Show descriptionKeys for @file and EndOfOptions (--)…
Browse files Browse the repository at this point in the history
… delimiter in resource bundles

Closes #1102
  • Loading branch information
remkop committed Jun 6, 2020
1 parent 7c5f1c1 commit 445999f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ To use the `ManPageGenerator` tool as a subcommand, you will need the `picocli-c
* [#1058][#1059] DOC: Man page generator: fix incorrect asciidoctor call in synopsis. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1058][#1060] DOC: Man page generator: add documentation about creating language variants. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1073] DOC: Improve user manual: fix typos, update content. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1102] DOC: Show `descriptionKeys` for `@file` and EndOfOptions (--) delimiter in resource bundles.
* [#1099] Dependency Upgrade: Bump JLine to 3.15.0. Thanks to [mattirn](https://github.com/mattirn) for the pull request.


Expand Down
21 changes: 21 additions & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3484,6 +3484,12 @@ Example command.
-V, --version Print version information and exit.
----

The description of the `@<filename>` entry can also be specified in a <<Internationalization,resource bundle>> for internationalization and localization.
The `descriptionKey` for the `@<filename>` entry in resource bundles is:

* `picocli.atfile`


=== Show End of Options

From picocli 4.3, an entry for the `--` <<Double dash (`--`),End of Options delimiter>> can be shown in the options list of the usage help message of a command with the `@Command(showEndOfOptionsDelimiterInUsageHelp = true)` annotation.
Expand Down Expand Up @@ -3580,6 +3586,12 @@ Example command.
-- End of options. Remainder are positional parameters.
----


The description of the End of Options delimiter entry can also be specified in a <<Internationalization,resource bundle>> for internationalization and localization.
The `descriptionKey` for the End of Options delimiter entry in resource bundles is:

* `picocli.endofoptions`

=== Show Default Values
==== `${DEFAULT-VALUE}` Variable
From picocli 3.2, it is possible to embed the <<Default Values,default values>> in the description for an option or positional parameter by
Expand Down Expand Up @@ -5307,10 +5319,19 @@ help = Show this help message and exit.
version = Print version information and exit.
# Exit Code Description
# ---------------------
usage.exitCodeListHeading = Exit Codes:%n
usage.exitCodeList.0 = \u00200:Successful program execution. (notice leading space '\u0020')
usage.exitCodeList.1 = 64:Usage error: user input for the command was incorrect.
usage.exitCodeList.2 = 70:An exception occurred when invoking the business logic of this command.
# @file Description
# -----------------
picocli.atfile=One or more argument files containing options, commands and positional parameters.
# End-of-Options (--) Delimiter Description
# -----------------------------------------
picocli.endofoptions = Separates options from positional parameters.
----

For options and positional parameters, the optional annotation attribute `descriptionKey` can be used to localize the description. For example:
Expand Down
1 change: 1 addition & 0 deletions src/test/java/picocli/EndOfOptionsDelimiterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class MyApp {

public static class MyResourceBundle extends ListResourceBundle {
protected Object[][] getContents() {
/** See {@link picocli.CommandLine.Help#END_OF_OPTIONS_OPTION} for the keys. */
return new Object[][] {
{"picocli.endofoptions", "hi! I am the -- end-of-options description from a file"},
//{"picocli.endofoptions.description", "BUNDLE -- DESCRIPTION"},
Expand Down

0 comments on commit 445999f

Please sign in to comment.