From 87f458d6638c88db6ddbeaf002c9cea42ba46f2b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bayle Date: Wed, 29 May 2019 14:51:46 +0200 Subject: [PATCH] Add function to disable implicit value --- include/cxxopts.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 63d6336..71a2afb 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -309,6 +309,9 @@ namespace cxxopts virtual std::shared_ptr implicit_value(const std::string& value) = 0; + virtual std::shared_ptr + no_implicit_value() = 0; + virtual bool is_boolean() const = 0; }; @@ -825,6 +828,13 @@ namespace cxxopts return shared_from_this(); } + std::shared_ptr + no_implicit_value() + { + m_implicit = false; + return shared_from_this(); + } + std::string get_default_value() const {