feat: introduce help. auto add help through parser generation like another action.

This commit is contained in:
2026-03-16 18:45:16 +04:00
parent 3a8e919ad1
commit a8b7078949
5 changed files with 110 additions and 6 deletions

View File

@@ -77,9 +77,8 @@ namespace argument_parser::v2 {
return base::get_optional<T>(arg);
}
void on_complete(std::function<void(argument_parser::base_parser const &)> const &action) {
base::on_complete(action);
}
using argument_parser::base_parser::display_help;
using argument_parser::base_parser::on_complete;
protected:
void set_program_name(std::string p) {
@@ -90,6 +89,9 @@ namespace argument_parser::v2 {
return base::parsed_arguments;
}
using argument_parser::base_parser::current_conventions;
using argument_parser::base_parser::reset_current_conventions;
private:
template <bool IsTyped, typename ActionType, typename T, typename ArgsMap>
void add_argument_impl(ArgsMap const &argument_pairs) {