Skip to content

Commit 5d3e747

Browse files
brasmussonmpkorstanje
authored andcommitted
[Core] Remove the deprecated -f/--format option.
1 parent 52bfa09 commit 5d3e747

File tree

5 files changed

+1
-13
lines changed

5 files changed

+1
-13
lines changed

core/src/main/java/cucumber/api/CucumberOptions.java

-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@
3636
*/
3737
String[] tags() default {};
3838

39-
/**
40-
* @return what formatter(s) to use
41-
* @deprecated use {@link #plugin()}
42-
*/
43-
@Deprecated
44-
String[] format() default {};
45-
4639
/**
4740
* @return what plugins(s) to use
4841
*/

core/src/main/java/cucumber/runtime/RuntimeOptions.java

-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ private void parse(List<String> args) {
155155
parsedTagFilters.add(args.remove(0));
156156
} else if (arg.equals("--plugin") || arg.equals("--add-plugin") || arg.equals("-p")) {
157157
parsedPluginData.addPluginName(args.remove(0), arg.equals("--add-plugin"));
158-
} else if (arg.equals("--format") || arg.equals("-f")) {
159-
System.err.println("WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.");
160-
parsedPluginData.addPluginName(args.remove(0), true);
161158
} else if (arg.equals("--no-dry-run") || arg.equals("--dry-run") || arg.equals("-d")) {
162159
dryRun = !arg.startsWith("--no-");
163160
} else if (arg.equals("--no-strict") || arg.equals("--strict") || arg.equals("-s")) {

core/src/main/java/cucumber/runtime/RuntimeOptionsFactory.java

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ private void addTags(CucumberOptions options, List<String> args) {
8787
private void addPlugins(CucumberOptions options, List<String> args) {
8888
List<String> plugins = new ArrayList<String>();
8989
plugins.addAll(asList(options.plugin()));
90-
plugins.addAll(asList(options.format()));
9190
for (String plugin : plugins) {
9291
args.add("--plugin");
9392
args.add(plugin);

core/src/main/resources/cucumber/api/cli/USAGE.txt

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Options:
1414
registration of 3rd party plugins.
1515
--add-plugin does not clobber plugins of that
1616
type defined from a different source.
17-
-f, --format FORMAT[:PATH_OR_URL] Deprecated. Use --plugin instead.
1817
-t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching
1918
TAG_EXPRESSION.
2019
-n, --name REGEXP Only run scenarios whose names match REGEXP.

examples/java-calculator-testng/src/test/java/cucumber/examples/java/calculator/RunCukesByCompositionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* AbstractTestNGCucumberTests but still executes each scenario as a separate
1515
* TestNG test.
1616
*/
17-
@CucumberOptions(strict = true, format = "json:target/cucumber-report-feature-composite.json")
17+
@CucumberOptions(strict = true, plugin = "json:target/cucumber-report-feature-composite.json")
1818
public class RunCukesByCompositionTest extends RunCukesByCompositionBase {
1919
private TestNGCucumberRunner testNGCucumberRunner;
2020

0 commit comments

Comments
 (0)