Merge pull request #11853 from xokdvium/dev/fix-verbosity-overflow-and-make-verbosity-strong-type

fix(libmain/common-args): do not exceed maximum allowed verbosity
This commit is contained in:
Jörg Thalheim 2024-11-14 00:52:41 +01:00 committed by GitHub
commit cb7c7af95d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,9 @@ MixCommonArgs::MixCommonArgs(const std::string & programName)
.shortName = 'v',
.description = "Increase the logging verbosity level.",
.category = loggingCategory,
.handler = {[]() { verbosity = (Verbosity) (verbosity + 1); }},
.handler = {[]() {
verbosity = (Verbosity) std::min<std::underlying_type_t<Verbosity>>(verbosity + 1, lvlVomit);
}},
});
addFlag({