Skip to content

Commit

Permalink
Merge pull request #42 from cloudRoutine/minor
Browse files Browse the repository at this point in the history
Minor Error Message Fixes
  • Loading branch information
eiriktsarpalis committed Dec 7, 2015
2 parents 065474a + 8008cc0 commit ca319c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages/*


Thumbs.db
*.obj
*.exe
Expand Down
8 changes: 4 additions & 4 deletions src/Argu/ArgInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ let uciToOpt (uci : UnionCaseInfo) =
| CliPrefix.DoubleDash -> "--"
| CliPrefix.Dash -> "-"
| CliPrefix.Empty -> ""
| p -> invalidArg "CliPrefix" "unsupported CLI prefix '%A'." p
| p -> invalidArg "CliPrefix" <| sprintf "unsupported CLI prefix '%s'." (string p)

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

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

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

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

Expand Down Expand Up @@ -291,9 +291,9 @@ let preComputeArgInfo (uci : UnionCaseInfo) : ArgInfo =
let isEqualsAssignment =
if uci.ContainsAttr<EqualsAssignmentAttribute> (true) then
if types.Length <> 1 then
failwith "Argu: Parameter '%s' has EqualsAssignment attribute but has arity <> 1." uci.Name
failwithf "Argu: Parameter '%s' has EqualsAssignment attribute but has arity <> 1." uci.Name
elif isRest then
failwith "Argu: Parameter '%s' contains incompatible attributes 'EqualsAssignment' and 'Rest'." uci.Name
failwithf "Argu: Parameter '%s' contains incompatible attributes 'EqualsAssignment' and 'Rest'." uci.Name
true
else
false
Expand Down
2 changes: 1 addition & 1 deletion src/Argu/Parsers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ with

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

0 comments on commit ca319c0

Please sign in to comment.