Skip to content

Commit

Permalink
#252 link to example version provider implementations from the docume…
Browse files Browse the repository at this point in the history
…ntation

Closes #252
  • Loading branch information
remkop committed Dec 21, 2017
1 parent 25a3d28 commit 63b4f92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public interface IVersionProvider {
}
```

The GitHub project has a manifest file-based [example](https://github.com/remkop/picocli/blob/master/examples/src/main/java/picocli/examples/VersionProviderDemo2.java) and a build-generated version properties file-based [example](https://github.com/remkop/picocli/blob/master/examples/src/main/java/picocli/examples/VersionProviderDemo1.java) version provider implementation.

### Custom factory
Declaratively registered subcommands, type converters and version providers must be instantiated somehow. From this release, a custom factory can be specified when constructing a `CommandLine` instance. This allows full control over object creation and opens possibilities for Inversion of Control and Dependency Injection. For example:

Expand All @@ -164,7 +166,7 @@ No features have been promoted in this picocli release.
- [#237] Option and Positional Parameter-specific type converters. Thanks to [godzsa](https://github.com/godzsa) for the request.
- [#236] Allow obtaining version information dynamically at runtime. Thanks to [kcris](https://github.com/kcris) for the request.
- [#169] Configurable factory to instantiate subcommands that are registered via annotation attributes. Thanks to [kakawait](https://github.com/kakawait) for the request.

- [#252] Example version provider implementations.

## <a name="2.2.0-deprecated"></a> Deprecations

Expand Down
5 changes: 5 additions & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,11 @@ public interface IVersionProvider {

Version providers declared with the `versionProvider` attribute need to have a public no-argument constructor to be instantiated, unless a <<Custom Factory>> is installed to instantiate classes.

The GitHub project has a manifest file-based
https://github.com/remkop/picocli/blob/master/examples/src/main/java/picocli/examples/VersionProviderDemo2.java[example]
and a build-generated version properties file-based
https://github.com/remkop/picocli/blob/master/examples/src/main/java/picocli/examples/VersionProviderDemo1.java[example] version provider implementation.

== Usage Help
=== Compact Example
A default picocli usage help message looks like this:
Expand Down

0 comments on commit 63b4f92

Please sign in to comment.