Automatically generate a custom command-line option parser from just the long-form help text for your program.
I am happy to announce release 1.5 of optparse.
Optparse's home page is at https://github.com/gvvaughan/optparse, with documentation at https://gvvaughan.github.io/optparse.
This was the option parser I originally wrote for Specl, and later donated to lua-stdlib. Even though I’ve been unable to complete the slimming down of lua-stdlib in preparation for the next release, you can continue to use optparse without any of stdlib.
This release fixes another long standing bug.
Install it with LuaRocks, using:
luarocks install optparse 1.5
Noteworthy changes in release 1.5 (2022-07-30) [stable]
Bug fixes
-
The parser no longer shadows the internal
optparse.version
on_handler
by also saving the last word of the parsed
versiontext
intooptparse.version
.But, we don't want to break existing clients that use the content
of the savedoptparse.version
string either. Since the
on_handler
was never available to callers before due to being
shadowed, rename it tooptparse.showversion
.
Incompatible changes
- For consistency with the renaming of
optparse.showversion
,
similarly renameoptparse.help
tooptparse.showhelp
. For
backwards compatibility,optparse.help
continues to be available
too, but is now undocumented. Consider using theshowhelp
in
your projects, especially if you also start usingshowversion
.