diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 4319c25c..bfaaa914 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -904,11 +904,15 @@ class App { // Check for options_ bool npos = false; - std::set groups; + std::vector groups; for(const Option_p &opt : options_) { if(opt->nonpositional()) { npos = true; - groups.insert(opt->get_group()); + + // Add group if it is not already in there + if(std::find(groups.begin(), groups.end(), opt->get_group()) == groups.end()) { + groups.push_back(opt->get_group()); + } } }