Skip to content

Commit

Permalink
[#1415] Bugfix/DOC: fix NullPointerException in README Example
Browse files Browse the repository at this point in the history
Closes #1415.
  • Loading branch information
remkop committed Aug 19, 2021
1 parent 750394c commit e6d072b
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -33,6 +33,7 @@ Picocli follows [semantic versioning](http://semver.org/).
* [#1331] Bugfix: Avoid `IllegalArgumentException` when parent has no standard help options and `scope = INHERIT`, while subcommand does have mixed-in standard help options. Thanks to [Andreas Deininger](https://github.com/deining) for raising this.
* [#1381][#1382] Bugfix: Default value of option in repeated subcommand was not applied correctly. Thanks to [sfeuerhahn](https://github.com/sfeuerhahn) for the pull request.
* [#1320][#1321] Bugfix/Enhancement: Use system properties `sun.stdout.encoding` and `sun.stderr.encoding` when creating the `PrintWriters` returned by `CommandLine::getOut` and `CommandLine::getErr`. Thanks to [Philippe Charles](https://github.com/charphi) for the investigation and the pull request.
* [#1415] Bugfix/DOC: fix NullPointerException in README Example. Thanks to [shannonbay](https://github.com/shannonbay) for raising this.
* [#1326][#1339] DOC: Added documentation and examples for controlling the locale. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1296] DOC: add Kotlin code samples to user manual; other user manual improvements. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1299] DOC: Link to `IParameterPreprocessor` from `IParameterConsumer` javadoc. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
Expand Down
5 changes: 5 additions & 0 deletions picocli-shell-jline3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public class Example {

CliCommands() {}

public void setReader(LineReader reader){
out = reader.getTerminal().writer();
}

public void run() {
out.println(new CommandLine(this).getUsageMessage());
}
Expand Down Expand Up @@ -250,6 +254,7 @@ public class Example {
.variable(LineReader.LIST_MAX, 50) // max tab completion candidates
.build();
builtins.setLineReader(reader);
commands.setReader(reader);
factory.setTerminal(terminal);
TailTipWidgets widgets = new TailTipWidgets(reader, systemRegistry::commandDescription, 5, TailTipWidgets.TipType.COMPLETER);
widgets.enable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ static class CliCommands implements Runnable {

CliCommands() {}

public void setReader(LineReader reader){
out = reader.getTerminal().writer();
}

public void run() {
out.println(new CommandLine(this).getUsageMessage());
}
Expand Down Expand Up @@ -158,6 +162,7 @@ public static void main(String[] args) {
.variable(LineReader.LIST_MAX, 50) // max tab completion candidates
.build();
builtins.setLineReader(reader);
commands.setReader(reader);
factory.setTerminal(terminal);
TailTipWidgets widgets = new TailTipWidgets(reader, systemRegistry::commandDescription, 5, TailTipWidgets.TipType.COMPLETER);
widgets.enable();
Expand Down

0 comments on commit e6d072b

Please sign in to comment.