- An array of functions can now be as the value of
converterproperty, so that multi-argumnet options can use different conversion rules for different arguments (#14). - Mutexes can now include positional arguments (#11).
- Added
hiddenproperty for arguments, options and commands, removing them from the autogenerated usage and help strings. - Added
:group(name, ...)method to Parser and Command objects, allowing custom grouping of arguments, options, and commands in autogenerated help string. - Added
help_vertical_spaceproperty for configuring number of extra newlines between help strings for different arguments and options in autogenerated help string. - Added
usage_marginandusage_max_widthproperties for configuring usage string autogeneration. - Added
help_usage_marginandhelp_description_marginproperties for configuring help string autogeneration. - Added
help_max_widthproperty. If set, descriptions in help string are automatically wrapped to fit into given number of columns. - Argparse version is now available as
argparse.version.
--can now be used as a normal option name, with arguments after--always passed to it verbatim (#17).- When generating help messages for options with arguments and multiple aliases, usage strings for different aliases are put on separate lines and vertically aligned (#15).
- Actions can now be used to implement custom processing logic.
- Added actions for arguments.
- Added string aliases for actions such as
store_false. - Command actions are now called after the parsing, with result target as the argument.
- Added
command_targetproperty for storing name of used command.
- Improved error messages on missing arguments.
-f123is now interpreted as-f 123when-ftakes an optional argument.
- Added license header to
argparse.luafor ease of bundling and packaging (#3).
- Removed
aliasesproperty, aliases can now be set using several space separated strings as name, or, as it was possible before, by settingnameproperty several times.
- Added
handle_optionsproperty (#2). - Often used properties now can be passed as arguments when calling or constructing an element.
- Cleaned up trailing whitespace in generated messages.
- Argparse no longer bundles 30log.
- Fixed incompatibility with old Luarocks versions.
- New
show_defaultfield disables automatic indication of default values in help messages.
- In default targets
-is now replaced with_. - Changed usage message generation to show options taking variable number of arguments after positional arguments.
- Fixed incompatibility with strict.lua and other checkers (#1).
- Added mutually exclusive groups.
- Options and arguments can now be configured to use different argument
placeholders for first, second, etc. arguments. E.g.
--pair <key> <value>.
- Fixed script name inference not working for
Parser:get_help()andParser:get_usage()methods.
Initial release.