Просмотр исходного кода

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 лет назад
Родитель
Сommit
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
 corosync-quorumtool \- Set and display quorum settings.
 .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
 Display the current state of quorum in the cluster and set vote quorum options.
 .SH OPTIONS
@@ -66,6 +66,9 @@ show node IP addresses instead of the resolved name
 .TP
 .B  -h (if no other argument)
 show this help text
+.TP
+.B  -V
+show version and exit
 .PP
 * Starred items only work if votequorum is the quorum provider for corosync
 .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");
 #endif
 	printf("  -h             show this help text\n");
+	printf("  -V             show version and exit\n");
 	printf("\n");
 	printf("  (*) Starred items only work if votequorum is the quorum provider for corosync\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));
 
 	if (!loop) {
-		printf("Version:          %s\n", VERSION);
 		if (get_quorum_type(quorumtype, sizeof(quorumtype))) {
 			strncpy(quorumtype, "Not configured", sizeof(quorumtype) - 1);
 		}
@@ -698,6 +698,9 @@ int main (int argc, char *argv[]) {
 				exit(2);
 			}
 			break;
+		case 'V':
+			printf("corosync-quorumtool version: %s\n", VERSION);
+			exit(0);
 		case ':':
 		case 'h':
 		case '?':