Skip to content

Commit

Permalink
Removing some appveyor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Nov 21, 2017
1 parent 23660c4 commit ca08532
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ install:
build_script:
- mkdir build
- cd build
- cmake .. -DCLI_SINGLE_FILE_TESTS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_GENERATOR="Visual Studio 14 2015"
- cmake .. -DCLI_SINGLE_FILE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR="Visual Studio 14 2015"
- cmake --build .

test_script:
- ctest --output-on-failure -C RelWithDebInfo
- ctest --output-on-failure -C Debug

notifications:
- provider: Webhook
Expand Down
6 changes: 3 additions & 3 deletions include/CLI/App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,9 @@ class App {

subcmd_groups_seen.insert(group_key);
out << std::endl << com->get_group() << ":" << std::endl;
for(const App_p &com : subcommands_)
if(detail::to_lower(com->get_group()) == group_key)
detail::format_help(out, com->get_name(), com->description_, wid);
for(const App_p &new_com : subcommands_)
if(detail::to_lower(new_com->get_group()) == group_key)
detail::format_help(out, new_com->get_name(), new_com->description_, wid);
}
}

Expand Down
9 changes: 5 additions & 4 deletions include/CLI/Option.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,18 @@ class Option : public OptionBase<Option> {

/// Process the callback
void run_callback() const {
bool result;
bool local_result;
// If take_last, only operate on the final item
if(last_) {
results_t partial_result = {results_.back()};
result = !callback_(partial_result);
local_result = !callback_(partial_result);
} else {
result = !callback_(results_);
local_result = !callback_(results_);
}

if(result)
if(local_result)
throw ConversionError(get_name() + "=" + detail::join(results_));

if(!validators_.empty()) {
for(const std::string &result : results_)
for(const std::function<bool(std::string)> &vali : validators_)
Expand Down
10 changes: 5 additions & 5 deletions tests/CreationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ TEST_F(TApp, MultipleSubcomMatching) {
}

TEST_F(TApp, RecoverSubcommands) {
CLI::App* app1 = app.add_subcommand("app1");
CLI::App* app2 = app.add_subcommand("app2");
CLI::App* app3 = app.add_subcommand("app3");
CLI::App* app4 = app.add_subcommand("app4");
CLI::App *app1 = app.add_subcommand("app1");
CLI::App *app2 = app.add_subcommand("app2");
CLI::App *app3 = app.add_subcommand("app3");
CLI::App *app4 = app.add_subcommand("app4");

EXPECT_EQ(app.get_subcommands(false), std::vector<CLI::App*>({app1, app2, app3, app4}));
EXPECT_EQ(app.get_subcommands(false), std::vector<CLI::App *>({app1, app2, app3, app4}));
}

TEST_F(TApp, MultipleSubcomMatchingWithCase) {
Expand Down

0 comments on commit ca08532

Please sign in to comment.