summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-10-17 12:54:17 +0000
committerChris Wilson <chris+github@qwirx.com>2007-10-17 12:54:17 +0000
commit7239aaba320fbc24dd608585ca417f804dab1950 (patch)
tree465db401c818c065a8b955618366c29ca94b11b2 /bin
parent891cf7aa3028cd32ee8c4f13cc24ec0cef774620 (diff)
Add "-h" and "/?" options to display usage in Daemon.
Extend usage info with service commands in BackupDaemon. Disable useless -D, -V and -k options on Windows. (merges 1855])
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp20
-rw-r--r--bin/bbackupd/BackupDaemon.h3
-rw-r--r--bin/bbstored/BackupStoreDaemon.cpp7
-rw-r--r--bin/bbstored/BackupStoreDaemon.h2
4 files changed, 19 insertions, 13 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 2f993b36..aaae003d 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -38,6 +38,8 @@
#include <process.h>
#endif
+#include <iostream>
+
#include "Configuration.h"
#include "IOStream.h"
#include "MemBlockStream.h"
@@ -209,13 +211,21 @@ const char *BackupDaemon::DaemonName() const
// Created: 1/1/04
//
// --------------------------------------------------------------------------
-const char *BackupDaemon::DaemonBanner() const
+std::string BackupDaemon::DaemonBanner() const
{
-#ifndef NDEBUG
- // Don't display banner in debug builds
- return 0;
-#else
return BANNER_TEXT("Backup Client");
+}
+
+void BackupDaemon::Usage()
+{
+ this->Daemon::Usage();
+
+#ifdef WIN32
+ std::cout <<
+ " -s Run as a Windows Service, for internal use only\n"
+ " -i Install Windows Service (you may want to specify a config file)\n"
+ " -r Remove Windows Service\n"
+ " -S <name> Service name for -i and -r options\n";
#endif
}
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index 3951a8aa..62f9c393 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -69,7 +69,8 @@ public:
void Run();
virtual const char *DaemonName() const;
- virtual const char *DaemonBanner() const;
+ virtual std::string DaemonBanner() const;
+ virtual void Usage();
const ConfigurationVerify *GetConfigVerify() const;
bool FindLocationPathName(const std::string &rLocationName, std::string &rPathOut) const;
diff --git a/bin/bbstored/BackupStoreDaemon.cpp b/bin/bbstored/BackupStoreDaemon.cpp
index c5d5fe40..28e28176 100644
--- a/bin/bbstored/BackupStoreDaemon.cpp
+++ b/bin/bbstored/BackupStoreDaemon.cpp
@@ -93,14 +93,9 @@ const char *BackupStoreDaemon::DaemonName() const
// Created: 1/1/04
//
// --------------------------------------------------------------------------
-const char *BackupStoreDaemon::DaemonBanner() const
+std::string BackupStoreDaemon::DaemonBanner() const
{
-#ifndef NDEBUG
- // Don't display banner in debug builds
- return 0;
-#else
return BANNER_TEXT("Backup Store Server");
-#endif
}
diff --git a/bin/bbstored/BackupStoreDaemon.h b/bin/bbstored/BackupStoreDaemon.h
index eb665440..387a1d5b 100644
--- a/bin/bbstored/BackupStoreDaemon.h
+++ b/bin/bbstored/BackupStoreDaemon.h
@@ -56,7 +56,7 @@ protected:
void Connection2(SocketStreamTLS &rStream);
virtual const char *DaemonName() const;
- virtual const char *DaemonBanner() const;
+ virtual std::string DaemonBanner() const;
const ConfigurationVerify *GetConfigVerify() const;