mirror of
https://github.com/jarro2783/cxxopts.git
synced 2026-08-29 01:25:31 +02:00
* 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.
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ TEST_CASE("Basic options", "[options]")
|
||||
CHECK(arguments[2].key() == "value");
|
||||
CHECK(arguments[3].key() == "av");
|
||||
|
||||
CHECK_THROWS_AS(result["nothing"].as<std::string>(), std::domain_error&);
|
||||
CHECK_THROWS_AS(result["nothing"].as<std::string>(), cxxopts::option_has_no_value_exception&);
|
||||
}
|
||||
|
||||
TEST_CASE("Short options", "[options]")
|
||||
|
||||
Reference in New Issue
Block a user