Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/CLI/impl/App_inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,9 +1413,11 @@ CLI11_INLINE void App::_process_requirements() {
}

CLI11_INLINE void App::_process() {
#ifndef CLI11_USE_OLD_HELP_PROCESSING
// help takes precedence over other potential errors and config and environment shouldn't be processed if help
// throws
_process_help_flags();
#endif // CLI11_USE_OLD_HELP_PROCESSING
std::exception_ptr config_exception;
try {
// the config file might generate a FileError but that should not be processed until later in the process
Expand All @@ -1427,12 +1429,20 @@ CLI11_INLINE void App::_process() {
} catch(const CLI::FileError &) {
config_exception = std::current_exception();
}
#ifndef CLI11_USE_OLD_HELP_PROCESSING
// callbacks and requirements processing can generate exceptions which should take priority
// over the config file error if one exists.
_process_requirements();
#endif // CLI11_USE_OLD_HELP_PROCESSING

_process_callbacks();

#ifdef CLI11_USE_OLD_HELP_PROCESSING
_process_help_flags();

_process_requirements();
#endif // CLI11_USE_OLD_HELP_PROCESSING

if(config_exception) {
std::rethrow_exception(config_exception);
}
Expand Down
Loading