Print help message for the last parsed subcommand (#822)

Co-authored-by: Philip Top <phlptp@gmail.com>
This commit is contained in:
Volker Christian
2023-01-02 16:14:19 +01:00
committed by GitHub
parent 3897109e51
commit 082dbf0e6e

View File

@@ -668,7 +668,7 @@ CLI11_NODISCARD CLI11_INLINE std::string App::help(std::string prev, AppFormatMo
// Delegate to subcommand if needed
auto selected_subcommands = get_subcommands();
if(!selected_subcommands.empty()) {
return selected_subcommands.at(0)->help(prev, mode);
return selected_subcommands.back()->help(prev, mode);
}
return formatter_->make_help(this, prev, mode);
}