Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add argument name after 'Too few arguments' error
  • Loading branch information
elpaso committed Jun 3, 2024
1 parent 58d7081 commit 0af7152
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,8 @@ class Argument {
std::bind(is_optional, std::placeholders::_1, m_prefix_chars));
dist = static_cast<std::size_t>(std::distance(start, end));
if (dist < num_args_min) {
throw std::runtime_error("Too few arguments");
throw std::runtime_error("Too few arguments for '" +
std::string(m_used_name) + "'.");
}
}

Expand Down

0 comments on commit 0af7152

Please sign in to comment.