A very simplistic CLI args parser. If you're looking for a proper / full-fledged one, check out elm-cli-options-parser.
Get the value of a CLI option/argument which you expect to be just a flag without any value associated with it:
getBooleanValue "debug" "--debug" == Just True
getBooleanValue "debug" "--debug=true" == Nothing
getBooleanValue "debug" "--enabled" == NothingGet the value of a CLI option/argument which you expect to be an integer:
getIntValue "count" "--count=5" == Just 5
getIntValue "count" "--count 5" == Just 5
getIntValue "count" "--file ./file_path.js" == NothingGet the value of a CLI option/argument which you expect to be an integer:
getFloatValue "factor" "--factor=5.5" == Just 5.5
getFloatValue "factor" "--factor 5.5" == Just 5.5
getFloatValue "factor" "--file ./file_path.js" == Nothing
Get the value of a CLI option/argument which you expect to be a string: