From cbf736cf145528c303c9a812517cddd8a7cad04f Mon Sep 17 00:00:00 2001 From: rpopma Date: Thu, 17 Aug 2017 23:58:19 +0900 Subject: [PATCH] #168 `setSeparator` method should return CommandLine Closes #168. --- RELEASE-NOTES.adoc | 5 +++-- src/main/java/picocli/CommandLine.java | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.adoc b/RELEASE-NOTES.adoc index cb4dc8d96..4ed25c4b2 100644 --- a/RELEASE-NOTES.adoc +++ b/RELEASE-NOTES.adoc @@ -3,10 +3,11 @@ == 1.0.0 - (Work in progress) Public release * (Work in progress) #121 Added support for command line complete: picocli can generate bash completion scripts that generate completion matches based on `@Option` and `@Command` annotations. +* #67 Support options for Map fields like `-Dkey1=val1 -Dkey2=val2` * #164 Support format patterns in version string and printVersionHelp * #166 Fixed bug where adjacent markup sections resulted in incorrect ANSI escape sequences -* #167 Change `@Option(type=Class)` attribute from `Class` to `Class[]` -* #67 Support options for Map fields like `-Dkey1=val1 -Dkey2=val2` +* #167 Change `type` attribute from `Class` to `Class[]` for Map support +* #168 API change: `CommandLine::setSeparator` method now returns this CommandLine (was void) == 0.9.8 - Bugfix and enhancements release for public review. API may change. diff --git a/src/main/java/picocli/CommandLine.java b/src/main/java/picocli/CommandLine.java index 4e23b234a..71bd41351 100644 --- a/src/main/java/picocli/CommandLine.java +++ b/src/main/java/picocli/CommandLine.java @@ -583,9 +583,11 @@ public String getSeparator() { } /** Sets the String the parser uses to separate option names from option values to the specified value. - * @param separator the String that separates option names from option values */ - public void setSeparator(String separator) { + * @param separator the String that separates option names from option values + * @return this {@code CommandLine} object, to allow method chaining */ + public CommandLine setSeparator(String separator) { interpreter.separator = Assert.notNull(separator, "separator"); + return this; } private static boolean empty(String str) { return str == null || str.trim().length() == 0; } private static boolean empty(Object[] array) { return array == null || array.length == 0; }