Skip to content

Commit

Permalink
junit-team#1498 incorporate feedback:
Browse files Browse the repository at this point in the history
* remove arity = "0..1" from disable-ansi-colors options: no need to accept a "true|false" parameter
* remove single-dash -fail-if-no-tests option: recently introduced so no worries about breaking existing apps
* option names attribute for --config option does not need to be an array
  • Loading branch information
remkop committed Aug 11, 2018
1 parent 53fa8cd commit 5a24172
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class AvailableOptions {
@Option(names = { "--h", "-help" }, help = true, hidden = true)
private boolean helpRequested2;

@Option(names = "--disable-ansi-colors", arity = "0..1", description = "Disable ANSI colors in output (not supported by all terminals).")
@Option(names = "--disable-ansi-colors", description = "Disable ANSI colors in output (not supported by all terminals).")
private boolean disableAnsiColors;

@Option(names = "-disable-ansi-colors", arity = "0..1", hidden = true)
@Option(names = "-disable-ansi-colors", hidden = true)
private boolean disableAnsiColors2;

@Option(names = "--details", paramLabel = "MODE", description = "Select an output details mode for when tests are executed. " //
Expand All @@ -74,10 +74,7 @@ class AvailableOptions {
private List<Path> additionalClasspathEntries2 = new ArrayList<>();

@Option(names = "--fail-if-no-tests", description = "Fail and return exit status code 2 if no tests are found.")
private boolean failIfNoTests;

@Option(names = "-fail-if-no-tests", hidden = true)
private boolean failIfNoTests2;
private boolean failIfNoTests; // no single-dash equivelent: was introduced in 5.3-M1

// --- Reports ---------------------------------------------------------

Expand Down Expand Up @@ -252,8 +249,7 @@ class AvailableOptions {
* @throws picocli.CommandLine.ParameterException if the map already contains this key
* @see <a href="https:/junit-team/junit5/issues/1308">#1308</a>
*/
@Option(names = {
"--config" }, paramLabel = "KEY=VALUE", arity = "1", description = "Set a configuration parameter for test discovery and execution. This option can be repeated.")
@Option(names = "--config", paramLabel = "KEY=VALUE", arity = "1", description = "Set a configuration parameter for test discovery and execution. This option can be repeated.")
public void setConfigurationParameters(Map<String, String> map) {
for (String key : map.keySet()) {
String newValue = map.get(key);
Expand Down Expand Up @@ -293,7 +289,7 @@ CommandLineOptions toCommandLineOptions(ParseResult parseResult) {
result.setDetails(choose(this.details, this.details2, CommandLineOptions.DEFAULT_DETAILS));
result.setTheme(choose(this.theme, this.theme2, CommandLineOptions.DEFAULT_THEME));
result.setAdditionalClasspathEntries(merge(this.additionalClasspathEntries, this.additionalClasspathEntries2));
result.setFailIfNoTests(this.failIfNoTests || this.failIfNoTests2);
result.setFailIfNoTests(this.failIfNoTests);

// Reports
result.setReportsDir(choose(this.reportsDir, this.reportsDir2, null));
Expand Down

0 comments on commit 5a24172

Please sign in to comment.