mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
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:
commit
cb7c7af95d
1 changed files with 3 additions and 1 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue