Skip to content

Commit

Permalink
style: pre-commit.ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 5, 2023
1 parent 78b97d5 commit f46e903
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
40 changes: 13 additions & 27 deletions include/CLI/impl/App_inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,46 +1480,32 @@ CLI11_INLINE bool App::_parse_single_config(const ConfigItem &item, std::size_t
if(op->get_items_expected_max() > 1) {
throw ArgumentMismatch::AtMost(item.fullname(), op->get_items_expected_max(), item.inputs.size());
}
if (op->get_disable_flag_override())
{
for (const auto& res : item.inputs)
{
if(op->get_disable_flag_override()) {
for(const auto &res : item.inputs) {
bool valid_value{false};
if (op->default_flag_values_.empty())
{
if (res == "true" || res == "false" || res == "1" || res == "0") {
valid_value=true;
if(op->default_flag_values_.empty()) {
if(res == "true" || res == "false" || res == "1" || res == "0") {
valid_value = true;

Check warning on line 1488 in include/CLI/impl/App_inl.hpp

View check run for this annotation

Codecov / codecov/patch

include/CLI/impl/App_inl.hpp#L1487-L1488

Added lines #L1487 - L1488 were not covered by tests
}
}
else
{
for (const auto& valid_res : op->default_flag_values_)
{
if (valid_res.second == res)
{
valid_value=true;
} else {
for(const auto &valid_res : op->default_flag_values_) {
if(valid_res.second == res) {
valid_value = true;
break;
}
}

}

if (valid_value)
{

if(valid_value) {
op->add_result(res);
}
else
{
} else {
throw InvalidError("invalid flag argument given");

Check warning on line 1502 in include/CLI/impl/App_inl.hpp

View check run for this annotation

Codecov / codecov/patch

include/CLI/impl/App_inl.hpp#L1502

Added line #L1502 was not covered by tests
}
}
return true;
}
else
{
} else {
throw ConversionError::TooManyInputsFlag(item.fullname());
}

}
}
op->add_result(item.inputs);
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzzFail/fuzz_app_file_fail4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-ccaaaa
-ccaaaa

0 comments on commit f46e903

Please sign in to comment.