From 7a2a9e1ccca07ba91a966d7a836b73bbc28eaf9b Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Fri, 31 Mar 2017 16:24:32 -0400 Subject: [PATCH] Removing help from config, more const correctness --- include/CLI/App.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 41b78dee..4fbf96e8 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -575,7 +575,7 @@ public: out << name << "=" << opt->count() << std::endl; // Flag, not present - } else if(opt->count() == 0 && default_also) { + } else if(opt->count() == 0 && default_also && opt.get() != get_help_ptr()) { out << name << "=false" << std::endl; } @@ -682,11 +682,20 @@ public: return help_ptr_; } + /// Get a pointer to the help flag. (const) + const Option* get_help_ptr() const { + return help_ptr_; + } + /// Get a pointer to the config option. Option* get_config_ptr() { return config_ptr_; } + /// Get a pointer to the config option. (const) + const Option* get_config_ptr() const { + return config_ptr_; + } /// Get the name of the current app std::string get_name() const { return name_;