فهرست منبع

quorumtool: fix version display info

we don't need that on every run

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Fabio M. Di Nitto 14 سال پیش
والد
کامیت
4345328a7d
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 4 1
      man/corosync-quorumtool.8
  2. 4 1
      tools/corosync-quorumtool.c

+ 4 - 1
man/corosync-quorumtool.8

@@ -35,7 +35,7 @@
 .SH NAME
 .SH NAME
 corosync-quorumtool \- Set and display quorum settings.
 corosync-quorumtool \- Set and display quorum settings.
 .SH SYNOPSIS
 .SH SYNOPSIS
-.B "corosync-quorumtool [\-s] [\-m] [\-l] [\-v votes] [\-n nodeid] [\-e expected] [\-h] [\-i]"
+.B "corosync-quorumtool [\-s] [\-m] [\-l] [\-v votes] [\-n nodeid] [\-e expected] [\-h] [\-i] [\-V]"
 .SH DESCRIPTION
 .SH DESCRIPTION
 Display the current state of quorum in the cluster and set vote quorum options.
 Display the current state of quorum in the cluster and set vote quorum options.
 .SH OPTIONS
 .SH OPTIONS
@@ -66,6 +66,9 @@ show node IP addresses instead of the resolved name
 .TP
 .TP
 .B  -h (if no other argument)
 .B  -h (if no other argument)
 show this help text
 show this help text
+.TP
+.B  -V
+show version and exit
 .PP
 .PP
 * Starred items only work if votequorum is the quorum provider for corosync
 * Starred items only work if votequorum is the quorum provider for corosync
 .SH SEE ALSO
 .SH SEE ALSO

+ 4 - 1
tools/corosync-quorumtool.c

@@ -139,6 +139,7 @@ static void show_usage(const char *name)
 	printf("  -f             forcefully unregister a quorum device *DANGEROUS* (*)\n");
 	printf("  -f             forcefully unregister a quorum device *DANGEROUS* (*)\n");
 #endif
 #endif
 	printf("  -h             show this help text\n");
 	printf("  -h             show this help text\n");
+	printf("  -V             show version and exit\n");
 	printf("\n");
 	printf("\n");
 	printf("  (*) Starred items only work if votequorum is the quorum provider for corosync\n");
 	printf("  (*) Starred items only work if votequorum is the quorum provider for corosync\n");
 	printf("\n");
 	printf("\n");
@@ -365,7 +366,6 @@ static int display_quorum_data(int is_quorate, uint32_t nodeid, int loop)
 	memset(quorumtype, 0, sizeof(quorumtype));
 	memset(quorumtype, 0, sizeof(quorumtype));
 
 
 	if (!loop) {
 	if (!loop) {
-		printf("Version:          %s\n", VERSION);
 		if (get_quorum_type(quorumtype, sizeof(quorumtype))) {
 		if (get_quorum_type(quorumtype, sizeof(quorumtype))) {
 			strncpy(quorumtype, "Not configured", sizeof(quorumtype) - 1);
 			strncpy(quorumtype, "Not configured", sizeof(quorumtype) - 1);
 		}
 		}
@@ -698,6 +698,9 @@ int main (int argc, char *argv[]) {
 				exit(2);
 				exit(2);
 			}
 			}
 			break;
 			break;
+		case 'V':
+			printf("corosync-quorumtool version: %s\n", VERSION);
+			exit(0);
 		case ':':
 		case ':':
 		case 'h':
 		case 'h':
 		case '?':
 		case '?':