Commit f59570328a765a8aae7fe0fff25ed4f4154d2b39
Committed by
GitHub
Merge pull request #24 from nathanhourt/patch-1
Fix #23: Respect fallthrough_ in _valid_subcommand
Showing
1 changed file
with
1 additions
and
1 deletions
include/CLI/App.hpp
| @@ -857,7 +857,7 @@ class App { | @@ -857,7 +857,7 @@ class App { | ||
| 857 | for(const App_p &com : subcommands_) | 857 | for(const App_p &com : subcommands_) |
| 858 | if(com->check_name(current)) | 858 | if(com->check_name(current)) |
| 859 | return true; | 859 | return true; |
| 860 | - if(parent_ != nullptr) | 860 | + if(parent_ != nullptr && fallthrough_) |
| 861 | return parent_->_valid_subcommand(current); | 861 | return parent_->_valid_subcommand(current); |
| 862 | else | 862 | else |
| 863 | return false; | 863 | return false; |