Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhay Raj Singh <abhayonlyone@gmail.com>2019-10-14 10:08:11 +0300
committerjarro2783 <jarro.2783@gmail.com>2019-10-14 10:08:11 +0300
commit073dd3e645fa0c853c3836f3788ca21c39af319d (patch)
tree607a5d605474b0e3ec6152751c2eea95a969bb06
parent4a0af0e95038450baa160ed7ba863072c39f457c (diff)
Fixed empty default showing nothing in help (#205)
-rw-r--r--include/cxxopts.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp
index ed3c6a2..e89c2e1 100644
--- a/include/cxxopts.hpp
+++ b/include/cxxopts.hpp
@@ -1513,7 +1513,14 @@ namespace cxxopts
if (o.has_default && (!o.is_boolean || o.default_value != "false"))
{
- desc += toLocalString(" (default: " + o.default_value + ")");
+ if(o.default_value != "")
+ {
+ desc += toLocalString(" (default: " + o.default_value + ")");
+ }
+ else
+ {
+ desc += toLocalString(" (default: \"\")");
+ }
}
String result;