public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* Cluster Project branch, master, updated. cluster-2.99.06-11-g6818dd7
@ 2008-07-16 14:53 ccaulfield
  0 siblings, 0 replies; only message in thread
From: ccaulfield @ 2008-07-16 14:53 UTC (permalink / raw)
  To: cluster-cvs, cluster-devel

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=6818dd7db3d7a1a91192889966f5cf6bd942047a

The branch, master has been updated
       via  6818dd7db3d7a1a91192889966f5cf6bd942047a (commit)
      from  d493de97ef6714d1ee576932adec1dad12428d65 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6818dd7db3d7a1a91192889966f5cf6bd942047a
Author: Christine Caulfield <ccaulfie@redhat.com>
Date:   Wed Jul 16 15:34:40 2008 +0100

    [CCS] add -c flag to ccs_tool query
    
    The -c (compat) flag displays the query results in the
    same format emitted by the old "ccs_test" tool.
    
    Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 ccs/ccs_tool/ccs_tool.c |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/ccs/ccs_tool/ccs_tool.c b/ccs/ccs_tool/ccs_tool.c
index b63b576..2d48633 100644
--- a/ccs/ccs_tool/ccs_tool.c
+++ b/ccs/ccs_tool/ccs_tool.c
@@ -140,15 +140,22 @@ static int xpath_query(int argc, char **argv)
 	int handle;
 	char *ret;
 	int i;
+	int compat_output = 0;
 
 	if (argc < 2) {
 		fprintf(stderr,
 			"Usage:\n"
 			"\n"
-			"ccs_tool query <xpath query>\n");
+			"ccs_tool query [-c] <xpath query>\n");
 		return 1;
 	}
 
+	if (strcmp(argv[1], "-c") == 0) {
+		argc--;
+		argv++;
+		compat_output = 1;
+	}
+
 	/* Tell the library we want full XPath parsing */
 	fullxpath = 1;
 
@@ -157,11 +164,22 @@ static int xpath_query(int argc, char **argv)
 	/* Process all the queries on the command-line */
 	for (i=1; i<argc; i++) {
 		if (!ccs_get(handle, argv[1], &ret)) {
-			printf("%s\n", ret);
+			if (compat_output) {
+				printf("Get successful.\n");
+				printf(" Value = <%s>\n", ret);
+			}
+			else {
+				printf("%s\n", ret);
+			}
 			free(ret);
 		}
 		else {
-			printf("Query failed: %s\n", strerror(errno));
+			if (compat_output) {
+				fprintf(stderr, "ccs_get failed: %s\n", strerror(errno));
+			}
+			else {
+				fprintf(stderr, "Query failed: %s\n", strerror(errno));
+			}
 			ccs_disconnect(handle);
 			return -1;
 		}
@@ -292,6 +310,7 @@ static void tool_print_usage(FILE *stream){
 	  "  query <ccs query>   Query the cluster configuration.\n"
 #else
 	  "  query <xpath query> Query the cluster configuration.\n"
+	  "  query [-c] <query>  Query the cluster configuration, old output format.\n"
 #endif
 	  "  addnode <node>      Add a node\n"
           "  delnode <node>      Delete a node\n"


hooks/post-receive
--
Cluster Project


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-16 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-16 14:53 Cluster Project branch, master, updated. cluster-2.99.06-11-g6818dd7 ccaulfield

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 read-only IMAP folder(s) and NNTP newsgroup(s).