-
Fixes #197. Don't parse default options twice when there is a short and long option.
-
Allow adding options with a single initializer list.
-
Improve parsing into std::vector so that a single argument can take a list.
-
* Parse 1 as "true" and 0 as "false" for boolean options.
-
Fixes #171. Allows invalid syntax for short options to be ignored.
-
Fixes #169. It seems reasonable to throw an exception when an attempt is made to parse into positional parameters that don't exist.
-
g++ 8.2.0 refuses to compile the test suite because of polymorphic types that are caught by value. They shall be caught by reference instead.
-
Fixes #124.
-
Fixes #101. Allows leading zeroes in the integer parser.
-
Allows unrecognised options to be left alone by the parser without throwing an exception.
-
This reverts commit 0f819a5cabb611ada4c41a5208c6bf1178f804be.
-
* Added const to argv type for better interoperability.
-
Fixes #93. This adds C++17 only support for `std::optional` values for command line parameters.
-
Fixes #96. Default values of options not specified on the command line had a `count` of 1. It would be better if they had a count of 0 because they were not actually specified, so that count is only for options given by the user.
-
* Add default "default" value of "false" to boolean options, therefore allowing to call result["boolOpt"].as<bool>() without throwing an exception.
-
Fixes #83. Adds an overload for positional arguments taking a `std::initializer_list`. When using an `initializer_list` with one argument, the function call is ambiguous matching both `std::string` and `std::vector<std::string>`.
-
Fixes #84. Implicit values are not handled very well. For example: --foo false true --foo --bar In the first, `false` is an argument to `--foo`, and then `true` is a positional argument. In the second, because of the hyphen in `--bar`, `--foo` is parsed with its implicit value. This seems inconsistent and unintuitive. Better is that implicit values *never* consume the next parameter to be completely consistent. This means that values with an implicit parameter *must* be specified using the `--option=value` form.
-
The parsing for boolean options was broken by 6c9bae4a07 which added implicit and default values, and the ability to parse boolean strings. Having an option after the boolean tried to parse that into the boolean instead of as a positional parameter. See #84 for the bug report.
-
Fixes #54. Allow default and implicit values for booleans with multiple boolean strings matched as values.
-
Fixes #74.
-
* Prevent malformed numbers from being parsed as correct numbers. Fixes #78. If you passed a string for example "test" it would get parsed to 1400. The problem was that the parser did not throw an exception when an incorrect char was encountered. Also a number without 0x in front with hexadecimal digits in it got parsed. The number was treated as a hexadecimal number but it was still calculated with base 10. So now before the current char is used, it is checked if it is valid in the current base. Furthermore the number 0x0 was not a valid number, it now is a special case in the `integer_pattern`. * Fixed `integer_pattern` so it works correctly under clang. Added testcase for invalid integers and for 0x0 being a valid number.
-
This is far from ideal, but it's the first step in moving the parse result to an immutable object so that the parser can be reused.
-
Adds generic parsing of types using `operator>>`, in particular allows parsing of floats and doubles.
-
Fixes #39. Closes #40. This is an overhaul of the way that integer arguments are parsed. Instead of using std::istream, which allows, for example, negative integers for unsigned types, we use our own parser. This allows us to do proper range checking depending on the type, and to correctly check for negative values passed to unsigned types. This also allows the handling of base 16 numbers.
-
Fixes #57. Allows spaces after the comma between the short and long option specification.
-
Fixes #50. This enables -Wall -Wextra -Wshadow and sets -Werror so that the build fails if there are any warnings. All warnings that came up are also fixed
-
Fixes #44. Adds a helper function for checking required options.
-
Fixes #47. Adds support for options that only have a short option.
-
Fixes #36. This fixes handling arguments passed after `--` when no positional arguments have been declared, or when the positional arguments have all been used up. The bug was that the extra arguments were lost. Now they are retained in the modified argv.