summaryrefslogtreecommitdiff
path: root/utilities/diatheke/diatheke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/diatheke/diatheke.cpp')
-rw-r--r--utilities/diatheke/diatheke.cpp66
1 files changed, 45 insertions, 21 deletions
diff --git a/utilities/diatheke/diatheke.cpp b/utilities/diatheke/diatheke.cpp
index 30add7b..159e3a5 100644
--- a/utilities/diatheke/diatheke.cpp
+++ b/utilities/diatheke/diatheke.cpp
@@ -1,9 +1,10 @@
-// Diatheke 4.5 by Chris Little <chrislit@crosswire.org>
-// Copyright 1999-2009 by CrossWire Bible Society
-// http://www.crosswire.org/sword/diatheke
-
-/*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+/******************************************************************************
+ *
+ * diatheke.cpp -
+ *
+ * $Id: diatheke.cpp 2903 2013-07-16 11:11:18Z chrislit $
+ *
+ * Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -19,6 +20,11 @@
*
*/
+/******************************************************************************
+ * Diatheke 4.6 by Chris Little <chrislit@crosswire.org>
+ * http://www.crosswire.org/sword/diatheke
+ */
+
#include "corediatheke.h"
#include "diathekemgr.h"
#include "diafiltmgr.h"
@@ -31,14 +37,14 @@ using std::cout;
void printsyntax() {
//if we got this far without exiting, something went wrong, so print syntax
- fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.5\n");
- fprintf (stderr, "Copyright 1999-2009 by the CrossWire Bible Society\n");
+ fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.6\n");
+ fprintf (stderr, "Copyright 1999-2013 by the CrossWire Bible Society\n");
fprintf (stderr, "http://www.crosswire.org/sword/diatheke/\n");
- fprintf (stderr, "usage: \n ");
- fprintf (stderr, "diatheke <-b module_name> [-s search_type] [-r search_range]\n");
- fprintf (stderr, "[-o option_filters] [-m maximum_verses] [-f output_format]\n");
- fprintf (stderr, "[-e output_encoding] [-t script] [-v variant#(-1=all|0|1)]\n");
- fprintf (stderr, "[-l locale] <-k query_key>\n");
+ fprintf (stderr, "\n");
+ fprintf (stderr, "usage: diatheke <-b module_name> [-s search_type] [-r search_range]\n");
+ fprintf (stderr, " [-o option_filters] [-m maximum_verses] [-f output_format]\n");
+ fprintf (stderr, " [-e output_encoding] [-v variant#(-1=all|0|1)]\n");
+ fprintf (stderr, " [-l locale] <-k query_key>\n");
fprintf (stderr, "\n");
fprintf (stderr, "If <book> is \"system\" you may use these system keys: \"modulelist\",\n");
fprintf (stderr, "\"modulelistnames\", and \"localelist\".");
@@ -48,15 +54,18 @@ void printsyntax() {
fprintf (stderr, " f (Footnotes), m (Morphology), h (Section Headings),\n");
fprintf (stderr, " c (Cantillation), v (Hebrew Vowels), a (Greek Accents), p (Arabic Vowels)\n");
fprintf (stderr, " l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping),\n");
- fprintf (stderr, " b (Bi-Directional Reordering), x (Red Words of Christ)\n");
+ fprintf (stderr, " b (Bi-Directional Reordering), w (Red Words of Christ),\n");
+ fprintf (stderr, " g (Glosses/Ruby), e (Word Enumerations),\n");
+ fprintf (stderr, " x (Encoded Transliterations), t (Algorithmic Transliterations via ICU)\n");
fprintf (stderr, "Maximum verses may be any integer value\n");
- fprintf (stderr, "Valid output_format values are: GBF, ThML, RTF, HTML, OSIS, CGI, and plain (def)\n");
+ fprintf (stderr, "Valid output_format values are: GBF, ThML, RTF, HTML, HTMLHREF, XHTML, OSIS,\n");
+ fprintf (stderr, " CGI, and plain (def)\n");
fprintf (stderr, "Valid output_encoding values are: Latin1, UTF8 (def), UTF16, HTML, and RTF\n");
fprintf (stderr, "Valid locale values depend on installed locales. en is default.\n");
fprintf (stderr, "The query_key must be the last argument because all following\n");
- fprintf (stderr, " arguments are added to the key.\n\n");
-
+ fprintf (stderr, " arguments are added to the key.\n");
+ fprintf (stderr, "\n");
fprintf (stderr, "Example usage:\n");
fprintf (stderr, " diatheke -b KJV -o fmnx -k Jn 3:16\n");
fprintf (stderr, " diatheke -b WHNU -t Latin -o mn -k Mt 24\n");
@@ -68,9 +77,10 @@ int main(int argc, char **argv)
int maxverses = -1;
unsigned char outputformat = FMT_PLAIN, searchtype = ST_NONE, outputencoding = ENC_UTF8;
unsigned long optionfilters = OP_NONE;
- char *text = 0, *locale = 0, *ref = 0, *script = 0, *range = 0;
+ char *text = 0, *locale = 0, *ref = 0, *range = 0;
+ char script[] = "Latin"; // for the moment, only this target script is supported
signed short variants = 0;
-
+
char runquery = 0; // used to check that we have enough arguments to perform a legal query
// (a querytype & text = 1 and a ref = 2)
@@ -141,10 +151,18 @@ int main(int argc, char **argv)
optionfilters |= OP_ARSHAPE;
if (strchr(argv[i+1], 'b'))
optionfilters |= OP_BIDI;
- if (strchr(argv[i+1], 'x'))
- optionfilters |= OP_RED;
+ if (strchr(argv[i+1], 'w'))
+ optionfilters |= OP_REDLETTERWORDS;
if (strchr(argv[i+1], 'p'))
optionfilters |= OP_ARABICPOINTS;
+ if (strchr(argv[i+1], 'g'))
+ optionfilters |= OP_GLOSSES;
+ if (strchr(argv[i+1], 'x'))
+ optionfilters |= OP_XLIT;
+ if (strchr(argv[i+1], 'e'))
+ optionfilters |= OP_ENUM;
+ if (strchr(argv[i+1], 't'))
+ optionfilters |= OP_TRANSLITERATOR;
i++;
}
}
@@ -170,6 +188,10 @@ int main(int argc, char **argv)
outputformat = FMT_HTML;
i++;
}
+ else if (!::stricmp("xhtml", argv[i+1])) {
+ outputformat = FMT_XHTML;
+ i++;
+ }
else if (!::stricmp("rtf", argv[i+1])) {
outputformat = FMT_RTF;
i++;
@@ -226,6 +248,7 @@ int main(int argc, char **argv)
i++;
}
}
+ /*
else if (!::stricmp("-t", argv[i])) {
if (i+1 <= argc) {
script = argv[i+1];
@@ -233,6 +256,7 @@ int main(int argc, char **argv)
i++;
}
}
+ */
}