This commit is contained in:
Sage Weil 2009-03-10 15:22:52 -07:00
parent 5de6ad8216
commit 9b7c9b0735
6 changed files with 54 additions and 21 deletions

View File

@ -377,18 +377,21 @@ int do_command(vector<string>& cmd, bufferlist& bl, string& rs, bufferlist& rbl)
void usage()
{
cerr << "usage: ceph [options] monhost] command" << std::endl;
cerr << "Options:" << std::endl;
cerr << " -m monhost -- specify monitor hostname or ip" << std::endl;
cerr << " -i infile -- specify input file" << std::endl;
cerr << " -o outfile -- specify output file" << std::endl;
cerr << " -w or --watch -- watch mds, osd, pg status (push)" << std::endl;
cerr << " -p or --poll -- watch mds, osd, pg status (poll)" << std::endl;
cerr << "usage: ceph [options] [commands]" << std::endl;
cerr << "If no commands are specified, enter interactive mode.\n";
cerr << "Commands:" << std::endl;
cerr << " stop -- cleanly shut down file system" << std::endl
<< " (osd|pg|mds) stat -- get monitor subsystem status" << std::endl
<< " ..." << std::endl;
exit(1);
cerr << "Options:" << std::endl;
cerr << " -i infile\n";
cerr << " -o outfile\n";
cerr << " specify input or output file (for certain commands)\n";
cerr << " -w or --watch\n";
cerr << " watch mds, osd, pg status changes in real time (push)\n";
cerr << " -p or --poll\n";
cerr << " watch mds, osd, pg status changes in real time (poll)\n";
generic_client_usage();
}
@ -549,6 +552,10 @@ int main(int argc, const char **argv, const char *envp[]) {
} else if (strcmp(args[i], "-p") == 0 ||
strcmp(args[i], "--poll") == 0) {
watch = 1;
} else if (args[i][0] == '-') {
if (strcmp(args[i], "-h"))
cerr << "unrecognized option " << args[i] << std::endl;
usage();
} else
nargs.push_back(args[i]);
}

View File

@ -35,10 +35,12 @@ using namespace std;
void usage()
{
cerr << "usage: cmds [flags] [--mds rank] [--shadow rank]" << std::endl;
cerr << " --debug_mds n debug MDS level (e.g. 10)" << std::endl;
cerr << " --debug_ms n debug messaging level (e.g. 1)" << std::endl;
exit(1);
cerr << "usage: cmds [flags] [--mds rank] [--shadow rank]\n";
cerr << " -m monitorip:port\n";
cerr << " connect to monitor at given address\n";
cerr << " --debug_mds n\n";
cerr << " debug MDS level (e.g. 10)\n";
generic_server_usage();
}
int main(int argc, const char **argv)

View File

@ -36,12 +36,10 @@ using namespace std;
void usage()
{
cerr << "usage: ./cmon [flags] <monfsdir>" << std::endl;
cerr << " -d daemonize" << std::endl;
cerr << " -o <dir> log output to dir/mon#" << std::endl;
cerr << " --debug_mon n debug monitor level (e.g. 10)" << std::endl;
cerr << " --debug_ms n debug messaging level (e.g. 1)" << std::endl;
exit(1);
cerr << "usage: cmon [flags] <monfsdir>" << std::endl;
cerr << " --debug_mon n\n";
cerr << " debug monitor level (e.g. 10)\n";
generic_server_usage();
}
int main(int argc, const char **argv)

View File

@ -800,6 +800,31 @@ void configure_client_mode()
g_conf.log_to_stdout = true;
}
void generic_usage()
{
cerr << " -C cluster.conf\n";
cerr << " get monitor IP(s) from given conf (instead of /etc/ceph/cluster.conf)\n";
cerr << " -c ceph.conf\n";
cerr << " get runtime options from given conf file" << std::endl;
}
void generic_server_usage()
{
cerr << " --debug_ms N\n";
cerr << " set message debug level (e.g. 1)\n";
cerr << " -D debug (no fork, log to stdout)\n";
cerr << " -f foreground (no fork, log to file)\n";
generic_usage();
exit(1);
}
void generic_client_usage()
{
generic_usage();
cerr << " -d daemonize (detach, fork, log to file)\n";
cerr << " -f foreground (no fork, log to file)" << std::endl;
exit(1);
}
void parse_config_options(std::vector<const char*>& args)
{
int opt_len = sizeof(config_optionsp)/sizeof(config_option);

View File

@ -361,6 +361,9 @@ extern bool parse_ip_port(const char *s, entity_addr_t& addr, const char **end=0
void configure_daemon_mode();
void configure_client_mode();
void generic_server_usage();
void generic_client_usage();
class ConfFile;
void parse_config_file(ConfFile *cf, bool update);

View File

@ -37,10 +37,8 @@ using namespace std;
void usage()
{
cerr << "usage: cosd <device> [-j journalfileordev] [-m monitor] [--mkfs_for_osd <nodeid>]" << std::endl;
cerr << " -d daemonize" << std::endl;
cerr << " --debug_osd N set debug level (e.g. 10)" << std::endl;
cerr << " --debug_ms N set message debug level (e.g. 1)" << std::endl;
exit(1);
generic_server_usage();
}