File tree 1 file changed +20
-3
lines changed
plugin/src/main/scala/templemore/sbt/cucumber
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,25 @@ trait Integration {
33
33
}
34
34
}
35
35
36
+ /*
37
+ * The options that are supported by the plugin.
38
+ * This excludes options that are set in other places such as formatting
39
+ * and dotcucumber etc.
40
+ *
41
+ * This is essentially a list of the parameter-less options supported by the
42
+ * `cucumber-jvm` `cucumber.runtime.RuntimeOptions` class
43
+ *
44
+ * The `--no-xxx` version of the options are not included as they are not enabled
45
+ * by default and are therefore not really necessary.
46
+ */
47
+ private val supportedOptions = Seq (" -d" ,
48
+ " --dry-run" ,
49
+ " -s" ,
50
+ " --strict" ,
51
+ " -m" ,
52
+ " --monochrome" )
53
+
54
+
36
55
private def runCucumber (args : Seq [String ],
37
56
jvmSettings : JvmSettings ,
38
57
options : Options ,
@@ -42,9 +61,7 @@ trait Integration {
42
61
def optsFromArgs = args.filter(isAnOption).toList
43
62
def namesFromArgs = args.filter(isAName).toList
44
63
45
- val optionPattern = """ -[a-z]""" .r.pattern
46
-
47
- def isAnOption (arg : String ) = (arg.startsWith(" --" ) || optionPattern.matcher(arg).matches())
64
+ def isAnOption (arg : String ) = supportedOptions.contains(arg)
48
65
def isATag (arg : String ) = arg.startsWith(" @" ) || arg.startsWith(" ~@" )
49
66
def isAName (arg: String ) = ! isATag(arg) && ! isAnOption(arg)
50
67
You can’t perform that action at this time.
0 commit comments