فهرست منبع

Fix bug in options parsing

Sam Jaffe 4 سال پیش
والد
کامیت
cd1585bec0
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      include/program_args/arguments_impl.hpp

+ 1 - 2
include/program_args/arguments_impl.hpp

@@ -129,8 +129,7 @@ Arguments<Impl>::Arguments(int argc, char const * const * const argv) {
         ++flags[id(arg)];
       }
     } else if (is_option(arg)) {
-      options[id(arg)].emplace_back(arg);
-      ++i;
+      options[id(arg)].emplace_back(argv[++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)) {