Skip to contentSkip to conversation

cluster/cman cman_tool/cman_tool.h cman_tool/m ...

Cluster-devel [email protected] 1 participant 1 message Sep 19, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rohara at sourceware.org 2007-09-19 15:59:46

Modified files:
cman/cman_tool : cman_tool.h main.c
cman/man : cman_tool.8

Log message:
Add ability to format output and filter based on node name.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/cman_tool.h.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/main.c.diff?cvsroot=cluster&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/man/cman_tool.8.diff?cvsroot=cluster&r1=1.12&r2=1.13

cman/cman_tool/cman_tool.h +10 -2
@@ -35,7 +35,6 @@
 #include <limits.h>
 #include <unistd.h>
 
-
 extern char *prog_name;
 
 #ifndef TRUE
@@ -50,13 +49,21 @@
 	exit(EXIT_FAILURE); \
 } while (0)
 
-
 #define DEFAULT_VOTES 1
 #define MAX_INTERFACES 10
+#define MAX_FORMAT_OPTS 10
 #define MAX_NODE_NAME_LEN 65
 #define MAX_MCAST_NAME_LEN 256
 #define MAX_PATH_LEN 256
 
+enum format_opt
+{
+	FMT_NONE,
+	FMT_ID,
+	FMT_NAME,
+	FMT_TYPE,
+	FMT_ADDR,
+};
 
 struct commandline
 {
@@ -67,6 +74,7 @@
         char *interfaces[MAX_INTERFACES];
 	char *override_nodename;
 	char *key_filename;
+	char *format_opts;
 	int votes;
 	int expected_votes;
 	int two_node;
cman/cman_tool/main.c +113 -21

213 lines not on this page · raw message

cman/man/cman_tool.8 +12 -1
@@ -242,7 +242,18 @@
 .TP
 .I -a
 Shows the IP address(es) the nodes are communicating on.
-
+.br
+.TP
+.I -n <nodename>
+Shows node information for a specific node. This should be the unqualified node
+name as it appears in 'cman_tool nodes'.
+.br
+.TP
+.I -F <format>
+Specify the format of the output. The format string may contain one or
+more format options, each seperated by a comma. Valid format options
+include: id, name, type, and addr.
+.br
 .SH "DEBUG" OPTIONS
 .TP
 .I -d <value>