}
// parse previous arguments if IN_ORDER is not set
for (const auto* const arg : args_free) m_argp->parse(Key::ARG, arg, this);
for (const auto* const arg : args_free)
{
err_code = m_argp->parse(Key::ARG, arg, this);
if (err_code != 0) goto error;
}
// parse rest argv as normal arguments
for (idx = idx + 1; idx < argc; idx++)
{
m_argp->parse(Key::ARG, args[idx], this);
err_code = m_argp->parse(Key::ARG, args[idx], this);
if (err_code != 0) goto error;
arg_cnt++;
}
if (arg_cnt == 0) m_argp->parse(Key::NO_ARGS, nullptr, this);
m_argp->parse(Key::END, nullptr, this);
m_argp->parse(Key::SUCCESS, nullptr, this);
err_code = m_argp->parse(Key::END, nullptr, this);
if (err_code != 0) goto error;
err_code = m_argp->parse(Key::SUCCESS, nullptr, this);
if (err_code != 0) goto error;
return 0;