[Box Backup-commit] COMMIT r3573 - in box/trunk: . infrastructure lib/server

subversion at boxbackup.org subversion at boxbackup.org
Wed Jun 10 20:45:59 BST 2015


Author: chris
Date: 2015-06-10 19:45:58 +0000 (Wed, 10 Jun 2015)
New Revision: 3573

Modified:
   box/trunk/infrastructure/buildenv-testmain-template.cpp
   box/trunk/lib/server/Daemon.cpp
   box/trunk/modules.txt
Log:
Add command-line help to test executables.

Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp
===================================================================
--- box/trunk/infrastructure/buildenv-testmain-template.cpp	2015-05-16 13:07:49 UTC (rev 3572)
+++ box/trunk/infrastructure/buildenv-testmain-template.cpp	2015-06-10 19:45:58 UTC (rev 3573)
@@ -41,10 +41,12 @@
 #endif
 
 #include <exception>
+#include <iostream>
 #include <list>
 #include <string>
 
 #include "box_getopt.h"
+#include "depot.h"
 #include "Logging.h"
 #include "Test.h"
 #include "Timer.h"
@@ -237,6 +239,23 @@
 
 #endif
 
+int Usage(const std::string& ProgramName)
+{
+	std::cout << 
+	"(built with QDBM " << dpversion << ")\n"
+	"\n"
+	"Usage: " << ProgramName << " [options]\n"
+	"\n"
+	"Options:\n"
+	"  -c/--bbackupd-args <args>     Arguments to pass to bbackupd/BackupDaemon\n"
+	"  -s/--bbstored-args <args>     Arguments to pass to bbstored/BackupStoreDaemon\n"
+	"  -d/--test-daemon-args <args>  Arguments to pass to TestDaemon\n"
+	"  -e/--execute-only <test>      Execute only specific named test, can repeat\n"
+	"  -h/--help                     Show this command-line help\n"
+	<< Logging::OptionParser::GetUsageString();
+	return 0;
+}
+
 int main(int argc, char * const * argv)
 {
 	// Start memory leak testing
@@ -250,11 +269,12 @@
 		{ "bbstored-args",	required_argument, NULL, 's' },
 		{ "test-daemon-args",	required_argument, NULL, 'd' },
 		{ "execute-only",	required_argument, NULL, 'e' },
+		{ "help",		no_argument, NULL,       'h' },
 		{ NULL,			0,                 NULL,  0  }
 	};
 
 	int c;
-	std::string options("c:d:e:s:");
+	std::string options("c:d:e:hs:");
 	options += Logging::OptionParser::GetOptionString();
 	Logging::OptionParser LogLevel;
 
@@ -289,6 +309,12 @@
 			}
 			break;
 
+			case 'h':
+			{
+				return Usage(argv[0]);
+			}
+			break;
+
 			case 's':
 			{
 				bbstored_args += " ";

Modified: box/trunk/lib/server/Daemon.cpp
===================================================================
--- box/trunk/lib/server/Daemon.cpp	2015-05-16 13:07:49 UTC (rev 3572)
+++ box/trunk/lib/server/Daemon.cpp	2015-06-10 19:45:58 UTC (rev 3573)
@@ -134,8 +134,8 @@
 	"  -k         Keep console open after fork, keep writing log messages to it\n"
 	"  -K         Stop writing log messages to console while daemon is running\n"
 	"  -o <file>  Log to a file, defaults to maximum verbosity\n"
-	"  -O <level> Set file log verbosity to error/warning/notice/info/trace/everything\n" <<
-	Logging::OptionParser::GetUsageString();
+	"  -O <level> Set file log verbosity to error/warning/notice/info/trace/everything\n"
+	<< Logging::OptionParser::GetUsageString();
 }
 
 // --------------------------------------------------------------------------

Modified: box/trunk/modules.txt
===================================================================
--- box/trunk/modules.txt	2015-05-16 13:07:49 UTC (rev 3572)
+++ box/trunk/modules.txt	2015-06-10 19:45:58 UTC (rev 3573)
@@ -15,11 +15,11 @@
 lib/compress
 lib/intercept
 
-test/common
-test/crypto		lib/crypto
-test/compress		lib/compress
-test/raidfile		lib/raidfile	lib/intercept
-test/basicserver	lib/server
+test/common		qdbm
+test/crypto		qdbm	lib/crypto
+test/compress		qdbm	lib/compress
+test/raidfile		qdbm	lib/raidfile	lib/intercept
+test/basicserver	qdbm	lib/server
 
 # IF_DISTRIBUTION(boxbackup)
 




More information about the Boxbackup-commit mailing list