summaryrefslogtreecommitdiffstats
path: root/ctdb/tools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-11-19 18:19:50 +1100
committerMartin Schwenke <martins@samba.org>2014-12-05 21:02:39 +0100
commit7428f809a76044fcbc98fd5f718e331ce183941d (patch)
tree13494e2d3e5f809d402670446ddb70e93214806c /ctdb/tools
parent3b90e45bae555cc4a47fe9958b86628d41084868 (diff)
downloadsamba-7428f809a76044fcbc98fd5f718e331ce183941d.tar.gz
samba-7428f809a76044fcbc98fd5f718e331ce183941d.tar.xz
samba-7428f809a76044fcbc98fd5f718e331ce183941d.zip
ctdb-tools: Add -X option for machine parsable output with separator '|'
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 3a1985bf22..8a4d3bdde6 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -6378,6 +6378,7 @@ int main(int argc, const char *argv[])
{
struct ctdb_context *ctdb;
char *nodestring = NULL;
+ int machineparsable = 0;
struct poptOption popt_options[] = {
POPT_AUTOHELP
POPT_CTDB_CMDLINE
@@ -6385,6 +6386,7 @@ int main(int argc, const char *argv[])
{ "node", 'n', POPT_ARG_STRING, &nodestring, 0, "node", "integer|all" },
{ "machinereadable", 'Y', POPT_ARG_NONE, &options.machinereadable, 0, "enable machine readable output", NULL },
{ NULL, 'x', POPT_ARG_STRING, &options.machineseparator, 0, "specify separator for machine readable output", "char" },
+ { NULL, 'X', POPT_ARG_NONE, &machineparsable, 0, "enable machine parsable output with separator |", NULL },
{ "verbose", 'v', POPT_ARG_NONE, &options.verbose, 0, "enable verbose output", NULL },
{ "maxruntime", 'T', POPT_ARG_INT, &options.maxruntime, 0, "die if runtime exceeds this limit (in seconds)", "integer" },
{ "print-emptyrecords", 0, POPT_ARG_NONE, &options.printemptyrecords, 0, "print the empty records when dumping databases (catdb, cattdb, dumpdbbackup)", NULL },
@@ -6442,6 +6444,9 @@ int main(int argc, const char *argv[])
}
}
+ if (machineparsable) {
+ options.machineseparator = "|";
+ }
if (options.machineseparator != NULL) {
if (strlen(options.machineseparator) != 1) {
printf("Invalid separator \"%s\" - "