Commit 1e51db16b5eba27c9a7a36a74561cfa19e220223

Authored by Jarryd Beck
1 parent 52e2f8b1

Minor tweaks

Showing 1 changed file with 28 additions and 20 deletions
include/cxxopts.hpp
@@ -243,13 +243,16 @@ namespace cxxopts @@ -243,13 +243,16 @@ namespace cxxopts
243 243
244 namespace cxxopts 244 namespace cxxopts
245 { 245 {
  246 + namespace
  247 + {
246 #ifdef _WIN32 248 #ifdef _WIN32
247 - const std::string LQUOTE("\'");  
248 - const std::string RQUOTE("\'"); 249 + const std::string LQUOTE("\'");
  250 + const std::string RQUOTE("\'");
249 #else 251 #else
250 - const std::string LQUOTE("‘");  
251 - const std::string RQUOTE("’"); 252 + const std::string LQUOTE("‘");
  253 + const std::string RQUOTE("’");
252 #endif 254 #endif
  255 + }
253 256
254 class Value : public std::enable_shared_from_this<Value> 257 class Value : public std::enable_shared_from_this<Value>
255 { 258 {
@@ -327,7 +330,7 @@ namespace cxxopts @@ -327,7 +330,7 @@ namespace cxxopts
327 { 330 {
328 public: 331 public:
329 option_exists_error(const std::string& option) 332 option_exists_error(const std::string& option)
330 - : OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists") 333 + : OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists")
331 { 334 {
332 } 335 }
333 }; 336 };
@@ -336,7 +339,7 @@ namespace cxxopts @@ -336,7 +339,7 @@ namespace cxxopts
336 { 339 {
337 public: 340 public:
338 invalid_option_format_error(const std::string& format) 341 invalid_option_format_error(const std::string& format)
339 - : OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE) 342 + : OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE)
340 { 343 {
341 } 344 }
342 }; 345 };
@@ -345,7 +348,7 @@ namespace cxxopts @@ -345,7 +348,7 @@ namespace cxxopts
345 { 348 {
346 public: 349 public:
347 option_not_exists_exception(const std::string& option) 350 option_not_exists_exception(const std::string& option)
348 - : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist") 351 + : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist")
349 { 352 {
350 } 353 }
351 }; 354 };
@@ -354,7 +357,9 @@ namespace cxxopts @@ -354,7 +357,9 @@ namespace cxxopts
354 { 357 {
355 public: 358 public:
356 missing_argument_exception(const std::string& option) 359 missing_argument_exception(const std::string& option)
357 - : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument") 360 + : OptionParseException(
  361 + u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument"
  362 + )
358 { 363 {
359 } 364 }
360 }; 365 };
@@ -363,7 +368,9 @@ namespace cxxopts @@ -363,7 +368,9 @@ namespace cxxopts
363 { 368 {
364 public: 369 public:
365 option_requires_argument_exception(const std::string& option) 370 option_requires_argument_exception(const std::string& option)
366 - : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument") 371 + : OptionParseException(
  372 + u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument"
  373 + )
367 { 374 {
368 } 375 }
369 }; 376 };
@@ -376,9 +383,11 @@ namespace cxxopts @@ -376,9 +383,11 @@ namespace cxxopts
376 const std::string& option, 383 const std::string& option,
377 const std::string& arg 384 const std::string& arg
378 ) 385 )
379 - : OptionParseException(  
380 - u8"Option " + LQUOTE + option + RQUOTE + u8" does not take an argument, but argument"  
381 - + LQUOTE + arg + RQUOTE + " given") 386 + : OptionParseException(
  387 + u8"Option " + LQUOTE + option + RQUOTE +
  388 + u8" does not take an argument, but argument" +
  389 + LQUOTE + arg + RQUOTE + " given"
  390 + )
382 { 391 {
383 } 392 }
384 }; 393 };
@@ -387,7 +396,7 @@ namespace cxxopts @@ -387,7 +396,7 @@ namespace cxxopts
387 { 396 {
388 public: 397 public:
389 option_not_present_exception(const std::string& option) 398 option_not_present_exception(const std::string& option)
390 - : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present") 399 + : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present")
391 { 400 {
392 } 401 }
393 }; 402 };
@@ -399,9 +408,9 @@ namespace cxxopts @@ -399,9 +408,9 @@ namespace cxxopts
399 ( 408 (
400 const std::string& arg 409 const std::string& arg
401 ) 410 )
402 - : OptionParseException(  
403 - u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse"  
404 - ) 411 + : OptionParseException(
  412 + u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse"
  413 + )
405 { 414 {
406 } 415 }
407 }; 416 };
@@ -410,10 +419,9 @@ namespace cxxopts @@ -410,10 +419,9 @@ namespace cxxopts
410 { 419 {
411 public: 420 public:
412 option_required_exception(const std::string& option) 421 option_required_exception(const std::string& option)
413 - : OptionParseException  
414 - (  
415 - u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present"  
416 - ) 422 + : OptionParseException(
  423 + u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present"
  424 + )
417 { 425 {
418 } 426 }
419 }; 427 };