diff --git a/cmdparser.hpp b/cmdparser.hpp index 3b31cb0..ec776ca 100644 --- a/cmdparser.hpp +++ b/cmdparser.hpp @@ -198,6 +198,13 @@ namespace cli { return std::stoull(elements[0], 0, numberBase); } + static long long parse(const std::vector& elements, const long long&, int numberBase = 0) { + if (elements.size() != 1) + throw std::bad_cast(); + + return std::stoll(elements[0], 0, numberBase); + } + static long parse(const std::vector& elements, const long&, int numberBase = 0) { if (elements.size() != 1) throw std::bad_cast();