Support the :regex type
Enhance parsing error to display available options
Module
28 changes across 14 versions
Changes by version
Support the :regex type
Enhance parsing error to display available options
Support :return_separator option
Add "did you mean?" suggestions to OptionParser.ParseError messages
Validate switch types/modifiers early on to give more precise feedback
Properly parse when numbers follow-up aliases, for example, -ab3 is now parsed as -a -b 3
Deprecate dynamic option parser mode that depended on atoms to be previously loaded and therefore behaved inconsistently
Add :allow_nonexistent_atoms to support unsafe behaviour prior to v1.4
Expand multi-letter aliases in OptionParser
Support options in OptionParser.to_argv/2 to ensure :count switches are correctly encoded
Deprecate aliases with multiple letters, such as -abc
Add support for :count switch type
Add parse!/2 and parse_head!/2 that raise OptionParser.ParseError in case of errors
Allow OptionParser to parse negative numbers
Add OptionParser.split/1 that splits a string into argv
--no-SWITCH are only allowed for declared booleans switches
Do not allow underscores in option names
Add :strict option that only parses known switches
Add next/2 useful for manual parsing of options
Parse - as a plain argument
-- is always removed from argument list on parse/2 and when it is the leading entry on parse_head/2
Errors on parsing returns the switch and value as binaries (unparsed)
Do not recognize undefined aliases as switches
parse and parse_head now returns a tuple with three elements instead of two
Do not add boolean flags to the end result if they were not given
Do not parse non-boolean flags as booleans when true or false are given
Ensure :keep and :integer|:float can be given together as options
Ensure --no-flag sets :flag to false when :flag is a registered boolean switch