From 30e436bba66673e17728e3ba3291b58dd16c1696 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Jul 2018 10:46:25 +0200 Subject: Add optional message to invalid_option exception --- cli/runtime-inline.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cli/runtime-inline.cxx') diff --git a/cli/runtime-inline.cxx b/cli/runtime-inline.cxx index 4f381ea..f6b1cee 100644 --- a/cli/runtime-inline.cxx +++ b/cli/runtime-inline.cxx @@ -113,9 +113,11 @@ generate_runtime_inline (context& ctx) << inl << "invalid_value::" << endl << "invalid_value (const std::string& option," << endl - << "const std::string& value)" << endl - << ": option_ (option)," - << " value_ (value)" + << "const std::string& value," << endl + << "const std::string& message)" << endl + << ": option_ (option)," << endl + << " value_ (value)," << endl + << " message_ (message)" << "{" << "}" @@ -129,6 +131,12 @@ generate_runtime_inline (context& ctx) << "value () const" << "{" << "return value_;" + << "}" + + << inl << "const std::string& invalid_value::" << endl + << "message () const" + << "{" + << "return message_;" << "}"; if (ctx.options.generate_file_scanner ()) -- cgit v1.1