Skip to content

Commit

Permalink
[#596] update documentation: show maven example that fails the build …
Browse files Browse the repository at this point in the history
…on error

Closes #596
  • Loading branch information
remkop committed Jan 10, 2019
1 parent 82f7c75 commit 7b901e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# <a name="3.9.1"></a> Picocli 3.9.1 (UNRELEASED)
The picocli community is pleased to announce picocli 3.9.1.

The `picocli.AutoComplete` application no longer calls `System.exit()` unless requested by setting system property `picocli.autocomplete.systemExitOnError` or `picocli.autocomplete.systemExitOnSuccess` to any value other than `false`. Applications that rely on the exit codes introduced in picocli 3.9.0 need to set these system properties.

This release adds support for quoted map keys with embedded '=' characters.

This release contains bugfixes and enhancements.

This is the forty-sixth public release.
Expand All @@ -27,6 +31,9 @@ Picocli follows [semantic versioning](http://semver.org/).
No features were deprecated in this release.

## <a name="3.9.1-breaking-changes"></a> Potential breaking changes
The `picocli.AutoComplete` application no longer calls `System.exit()` unless requested by setting system property `picocli.autocomplete.systemExitOnError` or `picocli.autocomplete.systemExitOnSuccess` to any value other than `false`.
Applications that rely on the exit codes introduced in picocli 3.9.0 need to set these system properties.

The new support for quoted map keys with embedded '=' characters [#594] may inpact some existing applications.
If `CommandLine::setTrimQuotes()` is set to `true`, quotes are now removed from map keys and map values. This did not use to be the case.

Expand Down
26 changes: 16 additions & 10 deletions docs/autocomplete.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ It may be useful to generate your completion scripts automatically during the bu
Below is an example Maven snippet that demonstrates how to achieve this.

=== Maven Example
TIP: Setting system property `picocli.autocomplete.systemExitOnError` ensures the build fails if there is any problem generating the completion script (requires picocli v3.9.1).

[source,xml]
----
<plugin>
Expand All @@ -346,19 +348,23 @@ Below is an example Maven snippet that demonstrates how to achieve this.
<id>generate-autocompletion-script</id>
<phase>package</phase>
<goals>
<goal>java</goal>
<goal>exec</goal>
</goals>
<configuration>
<mainClass>picocli.AutoComplete</mainClass>
<arguments>
<argument>--force</argument><!-- overwrite if exists -->
<argument>--completionScript</argument>
<argument>${project.build.directory}/mycommand_completion.sh</argument>
<argument>com.mycompany.mypackage.MyCommand</argument><!-- replace with your class -->
</arguments>
</configuration>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Dpicocli.autocomplete.systemExitOnError</argument>
<argument>-cp</argument>
<classpath/>
<argument>picocli.AutoComplete</argument>
<argument>--force</argument><!-- overwrite if exists -->
<argument>--completionScript</argument>
<argument>${project.build.directory}/mycommand_completion.sh</argument>
<argument>mypackage.MyCommand</argument><!-- replace with your class -->
</arguments>
</configuration>
</plugin>
----

Expand Down

0 comments on commit 7b901e9

Please sign in to comment.