mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Fix unused argument warnings.
Solution suggested by skrobinson. This way, GCC and clang-tidy don't generate warnings. Fixes: https://github.com/p-ranav/argparse/issues/167
This commit is contained in:
parent
2312342a62
commit
5c5c55b83c
@ -148,7 +148,7 @@ constexpr bool standard_integer =
|
||||
|
||||
template <class F, class Tuple, class Extra, std::size_t... I>
|
||||
constexpr decltype(auto) apply_plus_one_impl(F &&f, Tuple &&t, Extra &&x,
|
||||
std::index_sequence<I...> unused) {
|
||||
std::index_sequence<I...> /*unused*/) {
|
||||
return std::invoke(std::forward<F>(f), std::get<I>(std::forward<Tuple>(t))...,
|
||||
std::forward<Extra>(x));
|
||||
}
|
||||
@ -855,7 +855,7 @@ public:
|
||||
: m_program_name(std::move(program_name)), m_version(std::move(version)) {
|
||||
if ((add_args & default_arguments::help) == default_arguments::help) {
|
||||
add_argument("-h", "--help")
|
||||
.action([&](const auto &unused) {
|
||||
.action([&](const auto &/*unused*/) {
|
||||
std::cout << help().str();
|
||||
std::exit(0);
|
||||
})
|
||||
@ -866,7 +866,7 @@ public:
|
||||
}
|
||||
if ((add_args & default_arguments::version) == default_arguments::version) {
|
||||
add_argument("-v", "--version")
|
||||
.action([&](const auto &unused) {
|
||||
.action([&](const auto &/*unused*/) {
|
||||
std::cout << m_version << std::endl;
|
||||
std::exit(0);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user