Skip to content

Commit 9d32d7a

Browse files
committed
Improve help output
1 parent 08b9e7b commit 9d32d7a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/main/java/de/donnerbart/split/Arguments.java

+5-10
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,33 @@ class Arguments {
2626
@NotNull String glob;
2727

2828
@Parameter(names = {"--exclude-glob", "-e"},
29-
description = "Glob pattern to exclude test files. Defaults to '**/*Abstract*'. Make sure to single-quote the pattern to avoid shell expansion.")
29+
description = "Glob pattern to exclude test files. Make sure to single-quote the pattern to avoid shell expansion.")
3030
@Nullable String excludeGlob;
3131

3232
@Parameter(names = {"--junit-glob", "-j"},
3333
description = "Glob pattern to find JUnit reports. Make sure to single-quote the pattern to avoid shell expansion.")
3434
@Nullable String junitGlob;
3535

36-
@Parameter(names = {"--format", "-f"}, description = """
37-
The output format:
38-
* list: prints a space delimited list.
39-
* gradle: adds a '--tests' filter for each test.
40-
Defaults to 'list'.
41-
""", converter = FormatOptionConverter.class)
36+
@Parameter(names = {"--format", "-f"}, description = "The output format.", converter = FormatOptionConverter.class)
4237
@NotNull FormatOption format = FormatOption.LIST;
4338

4439
@Parameter(names = {"--averageTime", "-a"},
45-
description = "Use the average test time from tests with JUnit reports for tests without JUnit reports. Defaults to 'false'.")
40+
description = "Use the average test time from tests with JUnit reports for tests without JUnit reports.")
4641
boolean useAverageTimeForNewTests = false;
4742

4843
@Parameter(names = {"--working-directory", "-w"},
4944
description = "The working directory. Defaults to the current directory.")
5045
@Nullable Path workingDirectory;
5146

52-
@Parameter(names = {"--debug", "-d"}, description = "Enables debug logging. Defaults to 'false'.")
47+
@Parameter(names = {"--debug", "-d"}, description = "Enables debug logging.")
5348
boolean debug = false;
5449

5550
public static class FormatOptionConverter implements IStringConverter<FormatOption> {
5651

5752
@Override
5853
public @NotNull FormatOption convert(final @NotNull String value) {
5954
return Arrays.stream(FormatOption.values())
60-
.filter(option -> option.getParameterValue().equals(value))
55+
.filter(option -> option.toString().equals(value))
6156
.findFirst()
6257
.orElseThrow();
6358
}

src/main/java/de/donnerbart/split/FormatOption.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ public enum FormatOption {
1313
this.parameterValue = parameterValue;
1414
}
1515

16-
public @NotNull String getParameterValue() {
16+
@Override
17+
public String toString() {
1718
return parameterValue;
1819
}
1920
}

src/main/java/de/donnerbart/split/TestSplit.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public TestSplit(
8282
if (junitGlob != null) {
8383
LOG.info("JUnit glob: {}", junitGlob);
8484
}
85-
LOG.info("Output format: {}", format.getParameterValue());
85+
LOG.info("Output format: {}", format);
8686
final var testPaths = getPaths(workingDirectory, glob, excludeGlob);
8787
final var classNames = fileToClassName(testPaths, exitCodeConsumer);
8888
if (classNames.isEmpty()) {

0 commit comments

Comments
 (0)