diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-04-18 08:47:38 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-04-18 08:47:38 +0000 |
commit | 8a653921349ccc9af5203749954efd795b62c5b6 (patch) | |
tree | 051cfab91ee31abf29ea64e3d57aa3246235f9c3 | |
parent | 1ef44d9922592ca8486fbbb866e971c94666c747 (diff) |
Make bbackupctl status display the human-readable daemon state name.
-rw-r--r-- | bin/bbackupctl/bbackupctl.cpp | 17 | ||||
-rw-r--r-- | modules.txt | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp index becb1fcf..e7b85fdc 100644 --- a/bin/bbackupctl/bbackupctl.cpp +++ b/bin/bbackupctl/bbackupctl.cpp @@ -19,6 +19,7 @@ #include "box_getopt.h" #include "MainHelper.h" +#include "BackupDaemon.h" #include "BoxPortsAndFiles.h" #include "BackupDaemonConfigVerify.h" #include "Socket.h" @@ -236,7 +237,21 @@ int main(int argc, const char *argv[]) } else if (commandName == "status") { - BOX_NOTICE("state " << currentState); + std::string stateName; + + #define STATE(x) case BackupDaemon::State_ ## x: stateName = #x; break; + switch (currentState) + { + STATE(Initialising); + STATE(Idle); + STATE(Connected); + STATE(Error); + STATE(StorageLimitExceeded); + default: + stateName = "unknown"; + break; + } + BOX_NOTICE("state " << currentState << " " << stateName); command = NoCommand; } diff --git a/modules.txt b/modules.txt index 670f4ac4..cfa41271 100644 --- a/modules.txt +++ b/modules.txt @@ -33,7 +33,7 @@ bin/bbstored lib/raidfile lib/server lib/backupstore bin/bbstoreaccounts lib/raidfile lib/backupstore bin/bbackupd lib/server lib/backupclient qdbm bin/bbackupquery lib/server lib/backupclient -bin/bbackupctl lib/server lib/backupclient +bin/bbackupctl bin/bbackupd test/backupstore bin/bbstored bin/bbstoreaccounts lib/server lib/backupstore lib/backupclient lib/raidfile test/backupstorefix bin/bbstored bin/bbstoreaccounts lib/backupstore lib/raidfile bin/bbackupquery bin/bbackupd bin/bbackupctl |