@@ -83,6 +83,54 @@ To see all available options and formatters, run:
8383spotless --help
8484```
8585
86+ This will show you the available options and formatters as such:
87+
88+ <!-- -freshmark usage_main
89+ output =
90+ '```shell\n' +
91+ {{usage.main.array}}.join('\n') +
92+ '\n```';
93+ -->
94+
95+ ``` shell
96+ __ __
97+ _________ ____ / /_/ /__ __________
98+ / ___/ __ \/ __ \/ __/ / _ \/ ___/ ___/
99+ (__ ) /_/ / /_/ / /_/ / __(__ | __ )
100+ /____/ .___/\_ ___/\_ _/_/\_ __/____/____/ Spotless CLI
101+ /_/
102+
103+
104+ Usage: spotless [-hV] [-e=< encoding> ] [-l=< lineEnding> ] [-m=< spotlessMode> ]
105+ [-p= N] [-t=< targets> ]... [FORMATTING_STEPS]
106+ Runs spotless
107+ -e, --encoding=< encoding>
108+ The encoding of the files to format.
109+ (default: UTF-8)
110+ -h, --help Show this help message and exit.
111+ -l, --line-ending=< lineEnding>
112+ The line ending of the files to format.
113+ One of: GIT_ATTRIBUTES,
114+ GIT_ATTRIBUTES_FAST_ALLSAME, PLATFORM_NATIVE,
115+ WINDOWS, UNIX, MAC_CLASSIC, PRESERVE
116+ (default: UNIX)
117+ -m, --mode=< spotlessMode>
118+ The mode to run spotless in.
119+ One of: CHECK, APPLY
120+ (default: APPLY)
121+ -p, --parallelity=N The number of parallel formatter threads to run.
122+ (default: # cores * 0.5)
123+ -t, --target=< targets> The target files to format.
124+ -V, --version Print version information and exit.
125+
126+ Available formatting steps:
127+ license-header Runs license header
128+ google-java-format Runs google java format
129+ prettier Runs prettier
130+ ` ` `
131+
132+ < ! ---freshmark /usage_main -->
133+
86134# # Available Formatter Steps
87135
88136Spotless CLI supports the following formatter steps in alphabetical order:
@@ -107,7 +155,12 @@ Formats Java files according to the [google-java-format](https://github.com/goog
107155
108156To see usage instructions for the google-java-format formatter, run: ` spotless google-java-format --help`
109157
110- <!-- TODO implement mechanism to add this text dynamically from the cli (maybe using freshmark) -->
158+ < ! ---freshmark usage_google_java_format
159+ output =
160+ ' ```shell\n' +
161+ {{usage.google-java-format.array}}.join(' \n' ) +
162+ ' \n```' ;
163+ -->
111164
112165` ` ` shell
113166Usage: spotless google-java-format [-hijrV] [-s=< style> ]
@@ -126,6 +179,8 @@ Runs google java format
126179 -V, --version Print version information and exit.
127180` ` `
128181
182+ < ! ---freshmark /usage_google_java_format -->
183+
129184Example usage:
130185
131186` ` ` shell
@@ -138,6 +193,13 @@ Add or update a license header to the files.
138193
139194To see usage instructions for the license-header formatter, run: ` spotless license-header --help`
140195
196+ < ! ---freshmark usage_license_header
197+ output =
198+ ' ```shell\n' +
199+ {{usage.license-header.array}}.join(' \n' ) +
200+ ' \n```' ;
201+ -->
202+
141203` ` ` shell
142204Usage: spotless license-header [-hV] [-c=< contentPattern> ] [-d=< delimiter> ]
143205 [-m=< yearMode> ] [-s=< skipLinesMatching> ]
@@ -175,6 +237,8 @@ Runs license header
175237 (default: -)
176238` ` `
177239
240+ < ! ---freshmark /usage_license_header -->
241+
178242Example usage:
179243
180244` ` ` shell
@@ -190,6 +254,13 @@ Even more languages can be supported by including [prettier-plugins](https://pre
190254
191255To see usage instructions for the prettier formatter, run: ` spotless prettier --help`
192256
257+ < ! ---freshmark usage_prettier
258+ output =
259+ ' ```shell\n' +
260+ {{usage.prettier.array}}.join(' \n' ) +
261+ ' \n```' ;
262+ -->
263+
193264` ` ` shell
194265Usage: spotless prettier [-hV] [-C=< cacheDir> ] [-n=< explicitNpmExecutable> ]
195266 [-N=< explicitNodeExecutable> ]
@@ -217,6 +288,8 @@ Runs prettier
217288 -V, --version Print version information and exit.
218289` ` `
219290
291+ < ! ---freshmark /usage_prettier -->
292+
220293Example usage:
221294
222295` ` ` shell
0 commit comments