diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-24T08·53+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-24T08·53+0000 |
commit | 1a7468a57a11288a007c40d50ed28718d757a546 (patch) | |
tree | 175c3f3819298006548f4f7d00f4c98ce8135c6b /src/fix.cc | |
parent | b75719b98457c61857689ab135559a17034dd8ec (diff) |
* 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.
Diffstat (limited to 'src/fix.cc')
-rw-r--r-- | src/fix.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fix.cc b/src/fix.cc index afa0167ecdc0..8463c0ddb15d 100644 --- a/src/fix.cc +++ b/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 |