* `usage_margin`: sets margin for the second and following lines of
usage string.
* `usage_max_width`: sets usage max width for autowrapping.
* `help_usage_margin`: sets margin for element usages in help string.
* `help_description`: sets margin for element descrptions in help string.
There is little reason to use `_VERSION` instead of `version`.
`_VERSION` global is used by Lua itself, but module tables don't
have to worry about namespace clashes.
When converting an argument in a position, if there is a function
in the same position in provided converer array, use
it as a converter function.
This allows using an array of functions as the value of `convert` property,
with each function applied to corresponding argument of a multi-argument option.
Ref #14.
Allows saving name of used command in a field of result target.
Helpful when command callbacks are stored in a table with names as keys
or when they are in submodules of some namespace.
Example:
local parser = argparse():command_target("command")
-- Add commands...
local args = parser:parse()
require("namespace." .. args.command).run(args)
* For arguments: "argument 'foo' is required" -> "missing argument 'foo'"
* For options: "option '--foo' must be used at least 1 time" ->
"missing option '--foo'"
* Use state objects instead of tons of locals in the main
function.
* Use actions for storing arguments into result table.
Actions are now called at the end of each invocation,
with result table, target index, arguments and overwrite flag as
arguments.
* Remove command actions.
* Improve error messages, refer to options by the last used alias
instead of the main name.
TODO:
* Improve error messages further ("argument 'foo' is required"
-> "missing argument 'foo'", etc.).
* Add actions for positional arguments.
* Add actions for commands (should be called with final results
after parsing is over, in "innermost first" order).
* Allow referring to built-in actions by strings a-la Python
(e.g. action = "store_false").
* Allow setting initial value to be stored at target index
for each option (perhaps use default value for that).
* Add more tests, particularly for actions.