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
path: root/src
diff options
context:
space:
mode:
authorJarryd Beck <jarro.2783@gmail.com>2018-03-08 00:53:26 +0300
committerJarryd Beck <jarro.2783@gmail.com>2018-03-08 00:53:26 +0300
commite40645e0849b57976f5066b4e45d65253947e461 (patch)
treeba211a8c0fdc8a6687da315f3dc48676abade414 /src
parent76bd60dc17ca514f2febb49382b38d526d5502a5 (diff)
Don't show default when boolean false
Fixes #102. Don't show the default value when it is a boolean and the value is false. Note that this is a bit of a hack and the implementation should probably be reevaluated in the future.
Diffstat (limited to 'src')
-rw-r--r--src/example.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/example.cpp b/src/example.cpp
index b541774..64709f2 100644
--- a/src/example.cpp
+++ b/src/example.cpp
@@ -40,6 +40,7 @@ int main(int argc, char* argv[])
options.add_options()
("a,apple", "an apple", cxxopts::value<bool>(apple))
("b,bob", "Bob")
+ ("t,true", "True", cxxopts::value<bool>()->default_value("true"))
("f, file", "File", cxxopts::value<std::vector<std::string>>(), "FILE")
("i,input", "Input", cxxopts::value<std::string>())
("o,output", "Output file", cxxopts::value<std::string>()