-
Major refactor of the parsing code organisation to improve encapsulation and not modify the input arguments. The returned result no longer has pointers into the original option specification.
-
* Fix compiler warning C4702 for MSVC-14
-
`cxxopts` doesn't modify the contents of the argv strings. This changes the parse function to take a reference to a `const char**`.
-
Found with modernize-use-nodiscard Signed-off-by: Rosen Penev <rosenp@gmail.com>
-
* Fixes #245: * Added a new exception type: `option_has_no_value_exception`; throwing it when an option has no value we can cast with `as()`, instead of an `std::domain_error`. * The `OptionValue` type now holds a pointer to the long option name (in its corresponding key within ParseResults's `m_results` field.
-
Uses std::exit instead of abort to terminate when exceptions are disabled.
-
Fixes #201. Parse char type correctly and check for length.
-
Fix CXXOPTS_NO_EXCEPTIONS so that it doesn't warn about unused parameters, and print out error messages.
-
Fixes #197. Don't parse default options twice when there is a short and long option.
-
Allow adding options with a single initializer list.
-
Some positional parameters would be listed in the help text and others would not, when what is desired is that no positional parameters are listed with the other command options. This change suppresses the help listing for all positional parameters.
-
Improve parsing into std::vector so that a single argument can take a list.
-
These were detected using -fsanitize=undefined parsing values equal to INT_MAX and INT_MIN.
-
* Parse 1 as "true" and 0 as "false" for boolean options.
-
Fixes #171. Allows invalid syntax for short options to be ignored.
-
Fixes #175. This was broken when throwing an exception on missing positional parameters in #169.
-
Fixes #169. It seems reasonable to throw an exception when an attempt is made to parse into positional parameters that don't exist.
-
String literals with the prefix `u8` now have the type `const char8_t[N]` in C++20. As a consequence the library does not compile in c++2a mode with GCC (you can't concatenate `std::basic_string<char>` and `const char8_t[]` as `char` and `char8_t` are different types).
-
Fixes #166.
-
The empty string caused the vector to have one element which caused the test at line 2041 to always fail.
-
Windows is broken and defines `min` and `max` as a macro, adding parentheses stops them from being expanded.
-
Fixes #124.
-
Fixes #132. Since the map of options is shared between Options and ParseResult, they should use a shared pointer instead of a reference so that ParseResult can be returned without referencing destroyed memory.