Remove curly single-quotes only on Windows (#68)

This uses normal single quotes when on a Windows platform.
This commit is contained in:
giumas 2017-08-29 04:16:28 -04:00 committed by jarro2783
parent c2c2262626
commit 52e2f8b140

View File

@ -243,6 +243,14 @@ namespace cxxopts
namespace cxxopts namespace cxxopts
{ {
#ifdef _WIN32
const std::string LQUOTE("\'");
const std::string RQUOTE("\'");
#else
const std::string LQUOTE("");
const std::string RQUOTE("");
#endif
class Value : public std::enable_shared_from_this<Value> class Value : public std::enable_shared_from_this<Value>
{ {
public: public:
@ -319,7 +327,7 @@ namespace cxxopts
{ {
public: public:
option_exists_error(const std::string& option) option_exists_error(const std::string& option)
: OptionSpecException(u8"Option " + option + u8" already exists") : OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists")
{ {
} }
}; };
@ -328,7 +336,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 " + format + u8"") : OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE)
{ {
} }
}; };
@ -337,7 +345,7 @@ namespace cxxopts
{ {
public: public:
option_not_exists_exception(const std::string& option) option_not_exists_exception(const std::string& option)
: OptionParseException(u8"Option " + option + u8" does not exist") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist")
{ {
} }
}; };
@ -346,7 +354,7 @@ namespace cxxopts
{ {
public: public:
missing_argument_exception(const std::string& option) missing_argument_exception(const std::string& option)
: OptionParseException(u8"Option " + option + u8" is missing an argument") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument")
{ {
} }
}; };
@ -355,7 +363,7 @@ namespace cxxopts
{ {
public: public:
option_requires_argument_exception(const std::string& option) option_requires_argument_exception(const std::string& option)
: OptionParseException(u8"Option " + option + u8" requires an argument") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument")
{ {
} }
}; };
@ -368,9 +376,9 @@ namespace cxxopts
const std::string& option, const std::string& option,
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Option " + option + u8" does not take an argument, but argument" u8"Option " + LQUOTE + option + RQUOTE + u8" does not take an argument, but argument"
+ arg + " given") + LQUOTE + arg + RQUOTE + " given")
{ {
} }
}; };
@ -379,7 +387,7 @@ namespace cxxopts
{ {
public: public:
option_not_present_exception(const std::string& option) option_not_present_exception(const std::string& option)
: OptionParseException(u8"Option " + option + u8" not present") : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present")
{ {
} }
}; };
@ -391,9 +399,9 @@ namespace cxxopts
( (
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Argument " + arg + u8" failed to parse" u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse"
) )
{ {
} }
}; };
@ -402,10 +410,10 @@ namespace cxxopts
{ {
public: public:
option_required_exception(const std::string& option) option_required_exception(const std::string& option)
: OptionParseException : OptionParseException
( (
u8"Option " + option + u8" is required but not present" u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present"
) )
{ {
} }
}; };