Skip to content

Commit 40047a9

Browse files
committed
Pin required options to the top of the usage output
1 parent 432cdb0 commit 40047a9

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ java -jar split-tests-java.jar --split-index 0 --split-total 10 --glob 'project/
3939
```plain
4040
Usage: <main class> [options]
4141
Options:
42+
* --split-index, -i
43+
This test split index.
44+
Default: 0
45+
* --split-total, -t
46+
Total number of test splits.
47+
Default: 0
48+
* --glob, -g
49+
Glob pattern to find test files. Make sure to single-quote the pattern
50+
to avoid shell expansion.
4251
--calculate-optimal-total-split, -c
4352
Calculates the optimal test split (only on the first split index). Logs
4453
a warning if --split-total does not match.
@@ -53,9 +62,6 @@ Usage: <main class> [options]
5362
The output format.
5463
Default: list
5564
Possible Values: [list, gradle]
56-
* --glob, -g
57-
Glob pattern to find test files. Make sure to single-quote the pattern
58-
to avoid shell expansion.
5965
--help, -h
6066
Prints the usage.
6167
--junit-glob, -j
@@ -69,12 +75,6 @@ Usage: <main class> [options]
6975
reports.
7076
Default: average
7177
Possible Values: [zero, average, min, max]
72-
* --split-index, -i
73-
This test split index.
74-
Default: 0
75-
* --split-total, -t
76-
Total number of test splits.
77-
Default: 0
7878
--working-directory, -w
7979
The working directory. Defaults to the current directory.
8080
```

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ class Arguments {
1515
@Parameter(names = {"--help", "-h"}, description = "Prints the usage.", help = true)
1616
boolean help;
1717

18-
@Parameter(names = {"--split-index", "-i"}, description = "This test split index.", required = true)
18+
@Parameter(names = {"--split-index", "-i"}, description = "This test split index.", required = true, order = 0)
1919
int splitIndex;
2020

21-
@Parameter(names = {"--split-total", "-t"}, description = "Total number of test splits.", required = true)
21+
@Parameter(names = {"--split-total", "-t"},
22+
description = "Total number of test splits.",
23+
required = true,
24+
order = 1)
2225
int splitTotal;
2326

2427
@Parameter(names = {"--glob", "-g"},
2528
description = "Glob pattern to find test files. Make sure to single-quote the pattern to avoid shell expansion.",
26-
required = true)
29+
required = true,
30+
order = 2)
2731
@SuppressWarnings("NotNullFieldNotInitialized")
2832
@NotNull String glob;
2933

0 commit comments

Comments
 (0)