Skip to content

Releases: Sirraide/clopts

Release v3.0.1

28 Jul 02:39
Compare
Choose a tag to compare

Changelog

  • The options in the help message are now sorted.
  • The descriptions of positional options are now included in the help message.

Release v3.0.0

27 Jul 22:12
Compare
Choose a tag to compare

Breaking changes

This includes breaking changes, hence the new major version.

  • get<>() now returns a std::span<> instead of a std::vector<>* for multiple<> 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

22 May 22:08
Compare
Choose a tag to compare

Changelog

  • Add [[noreturn]] to the default help handler

Release v2.2.0

22 Feb 19:41
Compare
Choose a tag to compare

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 by parse() by calling the unprocessed() member function.
  • Fix crash when argv == nullptr. This was found through fuzz testing.
  • Internal option storage now uses std::bitset instead of std::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

22 Feb 02:59
Compare
Choose a tag to compare

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 respect values<> constraints.

Release v2.0.3

08 Nov 11:52
Compare
Choose a tag to compare

Changelog

  • Fixed a bug that caused the program to exit with code 0 instead of 1 on error.

v2.0.2

30 Oct 02:46
Compare
Choose a tag to compare

Changelog

  • Now uses user-generated static_assert messages for some of the asserts if your compiler supports that.

v2.0.1

23 Oct 10:56
Compare
Choose a tag to compare

Minor Update

  • Program name should now be printed correctly in error messages.
  • Test suite can now be run on Windows.

v2.0.0

18 Oct 23:07
Compare
Choose a tag to compare

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

  1. was technically scuffed as everything was just a bunch of global state, and
  2. 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

11 Aug 05:44
Compare
Choose a tag to compare

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.