Skip to content

Commit ca319c0

Browse files
Merge pull request #42 from cloudRoutine/minor
Minor Error Message Fixes
2 parents 065474a + 8008cc0 commit ca319c0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
packages/*
2+
3+
14
Thumbs.db
25
*.obj
36
*.exe

src/Argu/ArgInfo.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ let uciToOpt (uci : UnionCaseInfo) =
143143
| CliPrefix.DoubleDash -> "--"
144144
| CliPrefix.Dash -> "-"
145145
| CliPrefix.Empty -> ""
146-
| p -> invalidArg "CliPrefix" "unsupported CLI prefix '%A'." p
146+
| p -> invalidArg "CliPrefix" <| sprintf "unsupported CLI prefix '%s'." (string p)
147147

148148
prefixString + uci.Name.ToLower().Replace('_','-')
149149

@@ -260,7 +260,7 @@ let preComputeArgInfo (uci : UnionCaseInfo) : ArgInfo =
260260
| Some attr -> Some attr.Name
261261

262262
if AppSettingsName.IsNone && commandLineArgs.IsEmpty then
263-
failwith "Argu: parameter '%s' needs to have at least one parse source." uci.Name
263+
failwithf "Argu: parameter '%s' needs to have at least one parse source." uci.Name
264264

265265
let printLabels = uci.ContainsAttr<PrintLabelsAttribute> (true)
266266

@@ -291,9 +291,9 @@ let preComputeArgInfo (uci : UnionCaseInfo) : ArgInfo =
291291
let isEqualsAssignment =
292292
if uci.ContainsAttr<EqualsAssignmentAttribute> (true) then
293293
if types.Length <> 1 then
294-
failwith "Argu: Parameter '%s' has EqualsAssignment attribute but has arity <> 1." uci.Name
294+
failwithf "Argu: Parameter '%s' has EqualsAssignment attribute but has arity <> 1." uci.Name
295295
elif isRest then
296-
failwith "Argu: Parameter '%s' contains incompatible attributes 'EqualsAssignment' and 'Rest'." uci.Name
296+
failwithf "Argu: Parameter '%s' contains incompatible attributes 'EqualsAssignment' and 'Rest'." uci.Name
297297
true
298298
else
299299
false

src/Argu/Parsers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ with
3838

3939
// parses the first part of a command line parameter
4040
// recognizes if parameter is of kind --param arg or --param=arg
41-
let private assignRegex = new Regex("^([^=]*)=(.*)$", RegexOptions.Compiled)
41+
let private assignRegex = new Regex("^([^=]*)=(.*)$", RegexOptions.Compiled|||RegexOptions.IgnoreCase)
4242
let private parseEqualityParam (param : string) =
4343
let m = assignRegex.Match param
4444
if m.Success then

0 commit comments

Comments
 (0)