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/options.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cli/options.hxx') diff --git a/cli/options.hxx b/cli/options.hxx index dae58b6..dce59bd 100644 --- a/cli/options.hxx +++ b/cli/options.hxx @@ -153,7 +153,8 @@ namespace cli ~invalid_value () throw (); invalid_value (const std::string& option, - const std::string& value); + const std::string& value, + const std::string& message = std::string ()); const std::string& option () const; @@ -161,6 +162,9 @@ namespace cli const std::string& value () const; + const std::string& + message () const; + virtual void print (::std::ostream&) const; @@ -170,6 +174,7 @@ namespace cli private: std::string option_; std::string value_; + std::string message_; }; class eos_reached: public exception -- cgit v1.1