Commit 904793eab427444b60b1bddc5b4b1f9eb143c409
1 parent
3f4c165e
Fixing a few warnings
Showing
2 changed files
with
3 additions
and
3 deletions
include/CLI/App.hpp
| ... | ... | @@ -817,7 +817,7 @@ protected: |
| 817 | 817 | |
| 818 | 818 | if(require_subcommand_ < 0 && selected_subcommands_.size() == 0) |
| 819 | 819 | throw RequiredError("Subcommand required"); |
| 820 | - else if(require_subcommand_ > 0 && selected_subcommands_.size() != require_subcommand_) | |
| 820 | + else if(require_subcommand_ > 0 && selected_subcommands_.size() != (int) require_subcommand_) | |
| 821 | 821 | throw RequiredError(std::to_string(require_subcommand_) + " subcommand(s) required"); |
| 822 | 822 | |
| 823 | 823 | // Convert missing (pairs) to extras (string only) | ... | ... |
tests/AppTest.cpp
| ... | ... | @@ -518,8 +518,8 @@ TEST_F(TApp, RequiresMultiFlags) { |
| 518 | 518 | |
| 519 | 519 | TEST_F(TApp, RequiresMixedFlags) { |
| 520 | 520 | CLI::Option* opt1 = app.add_flag("--opt1"); |
| 521 | - CLI::Option* opt2 = app.add_flag("--opt2"); | |
| 522 | - CLI::Option* opt3 = app.add_flag("--opt3"); | |
| 521 | + app.add_flag("--opt2"); | |
| 522 | + app.add_flag("--opt3"); | |
| 523 | 523 | app.add_flag("--optall")->requires(opt1, "--opt2", "--opt3"); |
| 524 | 524 | |
| 525 | 525 | EXPECT_NO_THROW(run()); | ... | ... |