cli._VERSION
has been renamed tocli.VERSION
Function renames
The functions for defining arguments of all types have been renamed to drop the
_add
prefix from their names. This affects the following functions:
cli:add_argument
has been renamed tocli:argument
cli:add_option
has been renamed tocli:option
cli:add_flag
has been renamed tocli:flag
cli:optarg
has been renamed tocli:splat
Function alias removals
cli:add_opt
has been removed. Usecli:option
insteadcli:add_arg
has been removed. Usecli:argument
insteadcli:parse_args
has been removed. Usecli:parse
instead
cli:parse()
invocation changes
cli:parse()
no longer accepts the auxiliary arguments noprint
and dump
as the second and third arguments; only one argument is now accepted and that is a custom arguments table. If left unspecified, we use the global _G['arg']
program argument table as usual.
So, the new signature is:
cli:parse(args: table) -> table
- to make the parser silent, use
cli:set_silent(true)
before invoking the parser - to generate the internal state dump, a runtime argument
--__DUMP__
must be passed as the first argument
Private function are now hidden
Hopefully you weren't relying on any of these because they are no longer exposed, and they weren't documented. The affected previous exports are:
cli:__lookup()
cli:__add_opt()