Browse Source

Add support for -v2.

Sam Jaffe 4 years ago
parent
commit
e63446ba69
1 changed files with 2 additions and 0 deletions
  1. 2 0
      include/program_args/arguments_impl.hpp

+ 2 - 0
include/program_args/arguments_impl.hpp

@@ -131,6 +131,8 @@ Arguments<Impl>::Arguments(int argc, char const * const * const argv) {
     } else if (is_option(arg)) {
       options[id(arg)].emplace_back(arg);
       ++i;
+    } else if (is_flag(abbrev) && arg.find_last_not_of("0123456789") == 1) {
+      flags[id(abbrev)] = std::stoi(arg.substr(2));
     } else if (is_flag(abbrev)) {
       for (auto c : arg.substr(1)) {
         if (!is_flag(c)) { throw NotAnArgumentError({'-', c}); }