Releases: Sirraide/clopts
Release v3.0.1
Release v3.0.0
Breaking changes
This includes breaking changes, hence the new major version.
get<>()
now returns astd::span<>
instead of astd::vector<>*
formultiple<>
options.
Changelog
- Added a feature that allows options to reference other options during parsing.
- Added a feature that allows options to be overridden when specified more than once.
- Fixed a problem that caused us to no longer compile on Windows when compiling w/ MSVC 19.38 or later.
- Amended the test suite to make sure it still compiles in C++20 mode on both Linux and Windows.
Minor Update
Changelog
- Add
[[noreturn]]
to the default help handler
Release v2.2.0
Changelog
- Add a
stop_parsing<>
option that can be used to instruct the parser to... stop parsing. This is basically the familiar--
option, but you can also specify a different spelling if you’d like. Any unparsed options can be retrieved from the value returned byparse()
by calling theunprocessed()
member function. - Fix crash when
argv == nullptr
. This was found through fuzz testing. - Internal option storage now uses
std::bitset
instead ofstd::array<bool>
to track what options have already been found. - Improve error message if the
clopts<>
type is used with no options at all.
Release v2.1.0
This fixes some bugs wrt positional<values<>>
options:
- Fixed a bug that caused
positional<values<>>
options to overflow the help message buffer at compile time. - Fixed a bug that caused
positional<>
options to not respectvalues<>
constraints.
Release v2.0.3
Changelog
- Fixed a bug that caused the program to exit with code 0 instead of 1 on error.
v2.0.2
v2.0.1
v2.0.0
New version!
Now, you can reuse the same option type to parse options multiple times. As a result, this is a breaking change that also comes with some API changes. In particular, instead of
options::parse(argc, argv);
int x = *options::get<"--my-int-option">();
write
auto opts = options::parse(argc, argv);
int x = *opts.get<"--my-int-option">();
This is mainly because, while I still don’t see much of a use case for parsing command-line options more than once in the same invocation of a program, the previous approach
- was technically scuffed as everything was just a bunch of global state, and
- could lead to errors if the same option type was defined twice, because those two types would then be... the same type, and thus share state, which led to confusing errors during testing.
Also, we have tests now, so I guess I’ll know sooner if I end up breaking something.
v1.0.0
I haven’t really done any official releases so far, but I just added a useful feature that I’ve been wanting to add for a while, so I thought I might as well create one. Since this is a header-only library, the release is literally just the header...
Future releases will use SemVer; breaking changes to the API should be restricted to major version changes.