diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-05-28 15:35:42 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-05-28 15:35:42 +0000 |
commit | 4b9ea5a1e413ac0180007c4c59d8809621325d5b (patch) | |
tree | 775e846fab81dcf7fcfacc7a8ab09df0c43ae4ab /bin/bbackupquery/bbackupquery.cpp | |
parent | 4083d782afd068b60a8b2dacab3ed8a055d77bf7 (diff) |
Add bbackupquery -W<level> option to set explicit warning level,
Obsolete old (inconsistent) meaning of -q in bbackupquery.
Replace -q with -Wwarning or -Werror in tests to reduce noise and fix
tests.
Test that reading a nonexistent directory on the server doesn't crash
server or client.
Test that bbackupd does continue backup run and delete files when
storage limit is exceeded.
Use logging guards to hide expected warnings in testbbackupd.
Remove apparently pointless listing files on server at the end of
testbbackupd.
Diffstat (limited to 'bin/bbackupquery/bbackupquery.cpp')
-rw-r--r-- | bin/bbackupquery/bbackupquery.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp index 2ce227b2..a0926630 100644 --- a/bin/bbackupquery/bbackupquery.cpp +++ b/bin/bbackupquery/bbackupquery.cpp @@ -107,7 +107,6 @@ int main(int argc, const char *argv[]) #endif // Flags - bool quiet = false; bool readWrite = false; Logging::SetProgramName("Box Backup (bbackupquery)"); @@ -119,10 +118,10 @@ int main(int argc, const char *argv[]) #endif #ifdef WIN32 - const char* validOpts = "qvwuc:l:"; + const char* validOpts = "qvwuc:l:W:"; bool unicodeConsole = false; #else - const char* validOpts = "qvwc:l:"; + const char* validOpts = "qvwc:l:W:"; #endif // See if there's another entry on the command line @@ -133,9 +132,6 @@ int main(int argc, const char *argv[]) { case 'q': { - // Quiet mode - quiet = true; - if(masterLevel == Log::NOTHING) { BOX_FATAL("Too many '-q': " @@ -160,6 +156,17 @@ int main(int argc, const char *argv[]) } break; + case 'W': + { + masterLevel = Logging::GetNamedLevel(optarg); + if (masterLevel == Log::INVALID) + { + BOX_FATAL("Invalid logging level"); + return 2; + } + } + break; + case 'w': // Read/write mode readWrite = true; @@ -197,6 +204,13 @@ int main(int argc, const char *argv[]) Logging::SetGlobalLevel((Log::Level)masterLevel); + bool quiet = false; + if (masterLevel < Log::NOTICE) + { + // Quiet mode + quiet = true; + } + // Print banner? if(!quiet) { |