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 c1109e5 commit f1539ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 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

0 comments on commit f1539ac

Please sign in to comment.