diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index c8c99b6..b90f3c1 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -57,6 +57,7 @@ SOFTWARE. #include #include #include +#include #endif #ifndef ARGPARSE_CUSTOM_STRTOF @@ -730,6 +731,14 @@ class Argument { return *this; } + auto &store_into(std::filesystem::path &var) { + if (m_default_value.has_value()) { + var = std::any_cast(m_default_value); + } + action([&var](const std::string &s) { var = s; }); + return *this; + } + auto &store_into(std::vector &var) { if (m_default_value.has_value()) { var = std::any_cast>(m_default_value);