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 May 31, 2024
1 parent 9be9cba commit a87a5da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions include/CLI/impl/App_inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,18 +1490,13 @@ CLI11_INLINE bool App::_parse_single_config(const ConfigItem &item, std::size_t
}
if(op == nullptr) {
op = get_option_no_throw(item.name);
}
else if (!op->get_configurable())
{
} else if(!op->get_configurable()) {
auto *testop = get_option_no_throw(item.name);
if (testop != nullptr && testop->get_configurable())
{
op=testop;
if(testop != nullptr && testop->get_configurable()) {
op = testop;
}
}
}
else if (!op->get_configurable())
{
} else if(!op->get_configurable()) {
if(item.name.size() == 1) {
auto *testop = get_option_no_throw("-" + item.name);
if(testop != nullptr && testop->get_configurable()) {
Expand Down
4 changes: 2 additions & 2 deletions tests/ConfigFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,11 +1162,11 @@ TEST_CASE_METHOD(TApp, "notConfigurableOptionOverload2", "[config]") {
app.set_config("--conf", next);
int two{7};
int three{5};
app.add_option("-m",three)->configurable(false);
app.add_option("-m", three)->configurable(false);
app.add_option("m", two);

run();
CHECK(three==5);
CHECK(three == 5);
CHECK(two == 99);
}

Expand Down

0 comments on commit a87a5da

Please sign in to comment.