From 9910095719931f4a1a3be74d3a5d631851474ff8 Mon Sep 17 00:00:00 2001 From: linus-sherrill Date: Tue, 18 Jun 2019 04:16:31 -0400 Subject: [PATCH] Remove check for container when generating help message. (#170) 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 01e01ea..1381ab3 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1962,8 +1962,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; @@ -1982,8 +1981,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;