cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/ricci main.cpp
Date: 19 Feb 2008 16:01:39 -0000	[thread overview]
Message-ID: <20080219160139.3372.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2008-02-19 16:01:39

Modified files:
	ricci/ricci    : main.cpp 

Log message:
	Add a help dialog to be printed when the -h flag is given on the command line

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/main.cpp.diff?cvsroot=cluster&r1=1.10&r2=1.11

--- conga/ricci/ricci/main.cpp	2008/02/19 15:51:52	1.10
+++ conga/ricci/ricci/main.cpp	2008/02/19 16:01:39	1.11
@@ -47,6 +47,19 @@
 bool advertise_cluster = false;
 bool self_fence = false;
 
+void print_help(void) {
+	printf("Usage: ricci [options]\n\
+   -c         Announce cluster name and OS to unauthenticated clients.\n\
+   -d         Enable debugging.\n\
+   -f         Run in the foreground.\n\
+   -F         Enable support for commands that allow clients to force\n\
+              a reboot (same effect as /sbin/reboot -fn) as an alternative\n\
+              to proper fencing.\n\
+   -h         Print this help dialog.\n\
+   -p <port>  Listen for connections on the specified port.\n\
+   -u <uid>   Drop root and run with the specified uid.\n");
+}
+
 int drop_privs(uid_t new_uid) {
 	int ret;
 	cap_value_t saved_caps[] = { CAP_SYS_BOOT, CAP_SETUID };
@@ -116,7 +129,7 @@
 	int32_t ricci_port = RICCI_SERVER_PORT;
 	int ret;
 
-	while ((ret = getopt(argc, argv, "cdfFu:p:")) != EOF) {
+	while ((ret = getopt(argc, argv, "cdfFhu:p:")) != EOF) {
 		switch (ret) {
 			case 'c':
 				advertise_cluster = true;
@@ -134,6 +147,10 @@
 				self_fence = true;
 				break;
 
+			case 'h':
+				print_help();
+				exit(0);
+
 			case 'p':
 				if (optarg != NULL) {
 					uint32_t port;



             reply	other threads:[~2008-02-19 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19 16:01 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-19 15:51 [Cluster-devel] conga/ricci/ricci main.cpp rmccabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080219160139.3372.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).