mirror of
https://github.com/NixOS/nix
synced 2025-07-10 13:03:55 +02:00
* Debug levels. Use `--verbose / -v LEVEL' to display only messages
up to the given verbosity levels. These currently are: lvlError = 0, lvlNormal = 5, lvlDebug = 10, lvlDebugMore = 15 although only lvlError and lvlDebug are actually used right now.
This commit is contained in:
parent
b75719b984
commit
1a7468a57a
8 changed files with 68 additions and 25 deletions
10
src/fix.cc
10
src/fix.cc
|
@ -310,6 +310,16 @@ void run(Strings args)
|
|||
throw UsageError(format("argument required in `%1%'") % arg);
|
||||
state.searchDirs.push_back(*it++);
|
||||
}
|
||||
else if (arg == "--verbose" || arg == "-v") {
|
||||
if (it == args.end()) throw UsageError(
|
||||
format("`%1%' requires an argument") % arg);
|
||||
istringstream str(*it++);
|
||||
int lvl;
|
||||
str >> lvl;
|
||||
if (str.fail()) throw UsageError(
|
||||
format("`%1%' requires an integer argument") % arg);
|
||||
verbosity = (Verbosity) lvl;
|
||||
}
|
||||
else if (arg[0] == '-')
|
||||
throw UsageError(format("unknown flag `%1%`") % arg);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue