Minor tweaks

This commit is contained in:
Jarryd Beck 2017-08-29 18:20:28 +10:00
parent 52e2f8b140
commit 1e51db16b5

View File

@ -243,13 +243,16 @@ namespace cxxopts
namespace cxxopts namespace cxxopts
{ {
namespace
{
#ifdef _WIN32 #ifdef _WIN32
const std::string LQUOTE("\'"); const std::string LQUOTE("\'");
const std::string RQUOTE("\'"); const std::string RQUOTE("\'");
#else #else
const std::string LQUOTE(""); const std::string LQUOTE("");
const std::string RQUOTE(""); const std::string RQUOTE("");
#endif #endif
}
class Value : public std::enable_shared_from_this<Value> class Value : public std::enable_shared_from_this<Value>
{ {
@ -327,7 +330,7 @@ namespace cxxopts
{ {
public: public:
option_exists_error(const std::string& option) option_exists_error(const std::string& option)
: OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists") : OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists")
{ {
} }
}; };
@ -336,7 +339,7 @@ namespace cxxopts
{ {
public: public:
invalid_option_format_error(const std::string& format) invalid_option_format_error(const std::string& format)
: OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE) : OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE)
{ {
} }
}; };
@ -345,7 +348,7 @@ namespace cxxopts
{ {
public: public:
option_not_exists_exception(const std::string& option) option_not_exists_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist")
{ {
} }
}; };
@ -354,7 +357,9 @@ namespace cxxopts
{ {
public: public:
missing_argument_exception(const std::string& option) missing_argument_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument") : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument"
)
{ {
} }
}; };
@ -363,7 +368,9 @@ namespace cxxopts
{ {
public: public:
option_requires_argument_exception(const std::string& option) option_requires_argument_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument") : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument"
)
{ {
} }
}; };
@ -376,9 +383,11 @@ namespace cxxopts
const std::string& option, const std::string& option,
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" does not take an argument, but argument" u8"Option " + LQUOTE + option + RQUOTE +
+ LQUOTE + arg + RQUOTE + " given") u8" does not take an argument, but argument" +
LQUOTE + arg + RQUOTE + " given"
)
{ {
} }
}; };
@ -387,7 +396,7 @@ namespace cxxopts
{ {
public: public:
option_not_present_exception(const std::string& option) option_not_present_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present")
{ {
} }
}; };
@ -399,9 +408,9 @@ namespace cxxopts
( (
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse" u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse"
) )
{ {
} }
}; };
@ -410,10 +419,9 @@ namespace cxxopts
{ {
public: public:
option_required_exception(const std::string& option) option_required_exception(const std::string& option)
: OptionParseException : OptionParseException(
( u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present"
u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present" )
)
{ {
} }
}; };