File tree Expand file tree Collapse file tree
plugin/src/main/scala/templemore/sbt/cucumber Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,25 @@ trait Integration {
3333 }
3434 }
3535
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+
3655 private def runCucumber (args : Seq [String ],
3756 jvmSettings : JvmSettings ,
3857 options : Options ,
@@ -42,9 +61,7 @@ trait Integration {
4261 def optsFromArgs = args.filter(isAnOption).toList
4362 def namesFromArgs = args.filter(isAName).toList
4463
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)
4865 def isATag (arg : String ) = arg.startsWith(" @" ) || arg.startsWith(" ~@" )
4966 def isAName (arg: String ) = ! isATag(arg) && ! isAnOption(arg)
5067
You can’t perform that action at this time.
0 commit comments