We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7534545 commit 1f64772Copy full SHA for 1f64772
1 file changed
include/sharg/parser.hpp
@@ -639,6 +639,19 @@ class parser
639
640
operations.push_back(std::move(operation));
641
}
642
+
643
+ /*!\brief Adds subcommands to the parser.
644
+ * \param[in] subcommands A list of subcommands.
645
+ */
646
+ void add_subcommands(std::vector<std::string> const & subcommands)
647
+ {
648
+ auto & parser_subcommands = this->subcommands;
649
+ parser_subcommands.insert(parser_subcommands.end(), subcommands.cbegin(), subcommands.cend());
650
651
+ std::ranges::sort(parser_subcommands);
652
+ auto const [first, last] = std::ranges::unique(parser_subcommands);
653
+ parser_subcommands.erase(first, last);
654
+ }
655
//!\}
656
657
/*!\brief Aggregates all parser related meta data (see sharg::parser_meta_data struct).
0 commit comments