Skip to content

Commit 0810e76

Browse files
committed
chore: unify exec option naming with prettier
1 parent 239d526 commit 0810e76

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ output =
196196
-->
197197

198198
```
199-
Usage: spotless clang-format [-hV] [-p=<pathToExec>] [-s=<style>] [-v=<version>]
199+
Usage: spotless clang-format [-hV] [-c=<pathToExec>] [-s=<style>] [-v=<version>]
200200
Runs clang-format
201-
-h, --help Show this help message and exit.
202-
-p, --path-to-exec=<pathToExec>
201+
-c, --clang-format-exec=<pathToExec>
203202
The path to the clang-format executable.
204203
(default: looks on your PATH)
204+
-h, --help Show this help message and exit.
205205
-s, --style=<style> The style to use for clang-format.
206206
-v, --clang-version=<version>
207207
The version of clang-format to use.

Diff for: app/src/main/java/com/diffplug/spotless/cli/steps/ClangFormat.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ClangFormat extends SpotlessFormatterStep {
3737
String version;
3838

3939
@CommandLine.Option(
40-
names = {"--path-to-exec", "-p"},
40+
names = {"--clang-format-exec", "-c"},
4141
description = "The path to the clang-format executable." + OptionConstants.DEFAULT_VALUE_SUFFIX_BEGIN
4242
+ "looks on your PATH" + OptionConstants.DEFAULT_VALUE_SUFFIX_END)
4343
Path pathToExec;

Diff for: app/src/test/java/com/diffplug/spotless/cli/steps/ClangFormatTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void itFormatsFileType(String testFileName, String resourceName) throws Exceptio
6161
.withTargets(testFileName)
6262
.withStep(ClangFormat.class)
6363
.withOption("--clang-version", ClangFormatStep.defaultVersion())
64-
.withOption("--path-to-exec", clangFormatExec.getAbsolutePath())
64+
.withOption("--clang-format-exec", clangFormatExec.getAbsolutePath())
6565
.run();
6666

6767
assertFile(testFile).notSameSasResource(resourceName);
@@ -88,7 +88,7 @@ void itFormatsWithSpecificStyle() throws Exception {
8888
.withStep(ClangFormat.class)
8989
.withOption("--clang-version", ClangFormatStep.defaultVersion())
9090
.withOption("--style", "Google")
91-
.withOption("--path-to-exec", clangFormatExec.getAbsolutePath())
91+
.withOption("--clang-format-exec", clangFormatExec.getAbsolutePath())
9292
.run();
9393

9494
assertFile(testFile).notSameSasResource("clang/example.java.dirty");

0 commit comments

Comments
 (0)