Skip to content

Commit 63249e9

Browse files
committed
docs: improve documentation for main command
1 parent aaa6ffc commit 63249e9

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ output =
113113
Usage: spotless [-hV] [-e=<encoding>] [-l=<lineEnding>] [--log-file=<logFile>]
114114
[-m=<spotlessMode>] [-p=N] [-t=<targets>]... [-q | -v [-v]...]
115115
[FORMATTING_STEPS]
116-
Runs spotless
116+
117+
spotless is a command line interface (CLI) for the spotless code formatter.
118+
It can either check if your files are formatted according to your configuration
119+
or apply the formatting to the files.
120+
117121
-e, --encoding=<encoding> The encoding of the files to format.
118122
(default: UTF-8)
119123
-h, --help Show this help message and exit.
@@ -134,7 +138,11 @@ Runs spotless
134138
-p, --parallelity=N The number of parallel formatter threads to run.
135139
(default: #cores * 0.5)
136140
-q, --quiet Disable as much output as possible.
137-
-t, --target=<targets> The target files to format.
141+
-t, --target=<targets> The target files to format. Blobs are supported.
142+
Examples:
143+
-t 'src/**/*.java'
144+
-t 'src/**/*.kt'
145+
-t 'README.md'
138146
-v Enable verbose output. Multiple -v options
139147
increase the verbosity (max 5).
140148
-V, --version Print version information and exit.
@@ -153,8 +161,8 @@ Possible exit codes:
153161
for details).
154162
In CHECK mode, this means some files are not formatted properly (and
155163
might be fixed in APPLY mode).
156-
-1 Some files did not converge. This can happen in APPLY mode when the
157-
formatter does not converge on the file content.
164+
-1 Some files did not converge. This can happen when one formatter does not
165+
converge on the file content.
158166
-2 An exception occurred during execution.
159167
```
160168

app/src/main/java/com/diffplug/spotless/cli/SpotlessCLI.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
mixinStandardHelpOptions = true,
5454
usageHelpAutoWidth = true,
5555
versionProvider = SpotlessCLIVersionProvider.class,
56-
description = "Runs spotless",
56+
description =
57+
"%n@|magenta spotless|@ is a command line interface (CLI) for the spotless code formatter. "
58+
+ "%nIt can either check if your files are formatted according to your configuration or apply the formatting to the files.%n",
5759
header =
5860
"""
5961
__ __ \s
@@ -108,7 +110,13 @@ public class SpotlessCLI implements SpotlessAction, SpotlessCommand, SpotlessAct
108110

109111
@CommandLine.Option(
110112
names = {"--target", "-t"},
111-
description = "The target files to format.")
113+
description =
114+
"""
115+
The target files to format. Blobs are supported.
116+
Examples:
117+
-t 'src/**/*.java'
118+
-t 'src/**/*.kt'
119+
-t 'README.md'""")
112120
public List<String> targets;
113121

114122
@CommandLine.Option(

0 commit comments

Comments
 (0)