cmdopt2: actually advance positional parsing cursor

This commit is contained in:
Danny Robson 2022-03-21 10:51:19 +10:00
parent bc5aaae818
commit 40f2f3b99f

View File

@ -203,7 +203,8 @@ parser::parse (int const argc, const char *const *argv)
found_positional[pos_cursor] = true; found_positional[pos_cursor] = true;
auto &pos_arg = m_positional[pos_cursor]; auto &pos_arg = m_positional[pos_cursor];
if (pos_arg.acceptor1) if (pos_arg.acceptor1)
(*pos_arg.acceptor1) (argv[arg_cursor++]); (*pos_arg.acceptor1) (argv[arg_cursor]);
arg_cursor++;
} }
for (int i = 0, last = std::ssize (m_positional); i < last; ++i) for (int i = 0, last = std::ssize (m_positional); i < last; ++i)