From: ccaulfield@sourceware.org <ccaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.06-11-g6818dd7
Date: 16 Jul 2008 14:53:46 -0000 [thread overview]
Message-ID: <20080716145346.20579.qmail@sourceware.org> (raw)
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
reply other threads:[~2008-07-16 14:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080716145346.20579.qmail@sourceware.org \
--to=ccaulfield@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).