From 8c78f0e3af2056521d491c3a643770440689ad2a Mon Sep 17 00:00:00 2001 From: Linus Sherrill Date: Fri, 22 Mar 2019 14:47:58 -0400 Subject: [PATCH] Remove check for container when generating help message. Some positional parameters would be listed in the help text and others would not, when what is desired is that no positional parameters are listed with the other command options. This change suppresses the help listing for all positional parameters. --- include/cxxopts.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 94b81ef..2e02408 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1938,8 +1938,7 @@ Options::help_one_group(const std::string& g) const for (const auto& o : group->second.options) { - if (o.is_container && - m_positional_set.find(o.l) != m_positional_set.end() && + if (m_positional_set.find(o.l) != m_positional_set.end() && !m_show_positional) { continue; @@ -1958,8 +1957,7 @@ Options::help_one_group(const std::string& g) const auto fiter = format.begin(); for (const auto& o : group->second.options) { - if (o.is_container && - m_positional_set.find(o.l) != m_positional_set.end() && + if (m_positional_set.find(o.l) != m_positional_set.end() && !m_show_positional) { continue;