Skip to content

Commit f570e00

Browse files
committed
Use Cli.Validate.regexWithMessage when validating module name
Display validation message with an additional "I expected this to be" so the output becomes: ´´´ Validation errors: Invalid `--scalar-codecs` option. I expected this to be matching "^[A-Z][A-Za-z_]*(\.[A-Z][A-Za-z_]*)*$", but got 'src/CustomScalarCodecs' ´´´
1 parent d9cbaf7 commit f570e00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

generator/elm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"elm-version": "0.19.1",
77
"dependencies": {
88
"direct": {
9-
"dillonkearns/elm-cli-options-parser": "3.0.1",
9+
"dillonkearns/elm-cli-options-parser": "3.1.0",
1010
"elm/core": "1.0.5",
1111
"elm/json": "1.1.3",
1212
"elm/regex": "1.0.0",

generator/src/Main.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ baseOption =
165165

166166
validateModuleName : String -> Cli.Validate.ValidationResult
167167
validateModuleName =
168-
Cli.Validate.regex "^[A-Z][A-Za-z_]*(\\.[A-Z][A-Za-z_]*)*$"
168+
Cli.Validate.regexWithMessage "I expected this to be" "^[A-Z][A-Za-z_]*(\\.[A-Z][A-Za-z_]*)*$"
169169

170170

171171
type alias Flags =

0 commit comments

Comments
 (0)