Commit 9910095719931f4a1a3be74d3a5d631851474ff8

Authored by linus-sherrill
Committed by jarro2783
1 parent 9064fdf4

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.
Showing 1 changed file with 2 additions and 4 deletions
include/cxxopts.hpp
@@ -1962,8 +1962,7 @@ Options::help_one_group(const std::string& g) const @@ -1962,8 +1962,7 @@ Options::help_one_group(const std::string& g) const
1962 1962
1963 for (const auto& o : group->second.options) 1963 for (const auto& o : group->second.options)
1964 { 1964 {
1965 - if (o.is_container &&  
1966 - m_positional_set.find(o.l) != m_positional_set.end() && 1965 + if (m_positional_set.find(o.l) != m_positional_set.end() &&
1967 !m_show_positional) 1966 !m_show_positional)
1968 { 1967 {
1969 continue; 1968 continue;
@@ -1982,8 +1981,7 @@ Options::help_one_group(const std::string& g) const @@ -1982,8 +1981,7 @@ Options::help_one_group(const std::string& g) const
1982 auto fiter = format.begin(); 1981 auto fiter = format.begin();
1983 for (const auto& o : group->second.options) 1982 for (const auto& o : group->second.options)
1984 { 1983 {
1985 - if (o.is_container &&  
1986 - m_positional_set.find(o.l) != m_positional_set.end() && 1984 + if (m_positional_set.find(o.l) != m_positional_set.end() &&
1987 !m_show_positional) 1985 !m_show_positional)
1988 { 1986 {
1989 continue; 1987 continue;