Creating an MgrStandby in order to call its usage() method has
two problems:
1) MgrStandby wants to connect to a running cluster; if the
cluster isn't up, you'll be left staring at a blinking cursor.
2) MgrStandby::usage() doesn't print anything anyway.
This commit takes pretty much the same approach to printing
usage information as ceph_mon.cc, ceph_osd.cc and ceph_mds.cc.
Signed-off-by: Tim Serong <tserong@suse.com>
#include "mgr/MgrStandby.h"
+static void usage()
+{
+ cout << "usage: ceph-mgr -i <ID> [flags]\n"
+ << std::endl;
+ generic_server_usage();
+}
/**
* A short main() which just instantiates a MgrStandby and
// Handle --help
if ((args.size() == 1 && (std::string(args[0]) == "--help" || std::string(args[0]) == "-h"))) {
- MgrStandby mgr;
- mgr.usage();
- return 0;
+ usage();
}
global_init_daemonize(g_ceph_context);
int init();
void shutdown();
- void usage() {}
int main(vector<const char *> args);
void handle_signal(int signum);
void send_beacon();