summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'utilities')
-rw-r--r--utilities/Makefile.in1
-rw-r--r--utilities/diatheke/Makefile.in1
-rw-r--r--utilities/diatheke/README4
-rw-r--r--utilities/diatheke/corediatheke.cpp90
-rw-r--r--utilities/diatheke/corediatheke.h8
-rw-r--r--utilities/diatheke/diatheke.cpp53
-rw-r--r--utilities/diatheke/diathekemgr.cpp7
-rw-r--r--utilities/osis2mod.cpp107
8 files changed, 182 insertions, 89 deletions
diff --git a/utilities/Makefile.in b/utilities/Makefile.in
index 88e720e..b64304e 100644
--- a/utilities/Makefile.in
+++ b/utilities/Makefile.in
@@ -406,7 +406,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/utilities/diatheke/Makefile.in b/utilities/diatheke/Makefile.in
index c76a8c5..3971a8a 100644
--- a/utilities/diatheke/Makefile.in
+++ b/utilities/diatheke/Makefile.in
@@ -216,7 +216,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/utilities/diatheke/README b/utilities/diatheke/README
index 7421a6d..df39d86 100644
--- a/utilities/diatheke/README
+++ b/utilities/diatheke/README
@@ -47,6 +47,8 @@ default page to create a custom index.html for your users.
----------------------------------------------------------------------
VERSION HISTORY
+4.7
+
4.6 July 16, 2013
Updated for Sword 1.7.0.
@@ -75,7 +77,7 @@ VERSION HISTORY
COPYRIGHT
The Diatheke Suite and its components, Diatheke, Diatheke/CGI, and
-Diatheke/Tcl are Copyright 1999-2013 by CrossWire Bible Society.
+Diatheke/Tcl are Copyright 1999-2014 by CrossWire Bible Society.
HANDiatheke is Copyright 2000-2001 by CrossWire Bible Society.
The Diatheke Suite and all of its components are licensed through
the GNU General Public License and are intended for free distribution.
diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp
index 37f9448..6e05e7c 100644
--- a/utilities/diatheke/corediatheke.cpp
+++ b/utilities/diatheke/corediatheke.cpp
@@ -2,9 +2,9 @@
*
* corediatheke.cpp -
*
- * $Id: corediatheke.cpp 2931 2013-07-31 13:07:26Z scribe $
+ * $Id: corediatheke.cpp 3207 2014-05-01 02:48:10Z greg.hellings $
*
- * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2001-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -120,17 +120,28 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
ListKey listkey;
SectionMap::iterator sit;
ConfigEntMap::iterator eit;
-
SWModule *target;
+
char *font = 0;
+ SWBuf modlanguage;
+ SWBuf modlocale;
+ SWBuf syslanguage;
+ SWBuf syslocale;
char inputformat = 0;
SWBuf encoding;
char querytype = 0;
- if (locale) {
- LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale);
+ if (!locale) { locale = "en";
}
+
+ syslocale = SWBuf(locale);
+ syslocale.append(".en");
+ LocaleMgr *lom = LocaleMgr::getSystemLocaleMgr();
+ lom->setDefaultLocaleName(syslocale);
+ syslanguage = lom->translate(syslocale, "locales");
+
+
//deal with queries to "system"
if (!::stricmp(text, "system")) {
querytype = QT_SYSTEM;
@@ -148,6 +159,19 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
target = (*it).second;
SWKey *p = target->createKey();
VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p);
+
+
+ if (target->getLanguage()) {
+ modlocale = target->getLanguage();
+ LocaleMgr *lm = LocaleMgr::getSystemLocaleMgr();
+ modlanguage = lm->translate(modlocale.append(".en"), "locales");
+ modlocale -= 3;
+ }
+ else {
+ modlocale = "en";
+ modlanguage = "English";
+ }
+
if (!parser) {
delete p;
parser = new VerseKey();
@@ -314,15 +338,17 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ";}}";
}
else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
- *output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
+ *output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
+ " lang=\"" << locale << "\" xml:lang=\"" << locale << "\"/>";
}
+
if (text.length()) {
*output << (char*)target->getKeyText();
+ *output << (char*)target->getKeyText();
if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << ": <font face=\"";
- *output << font;
- *output << "\">";
+ *output << ": <span style=\"font:\"" << font << ";\""
+ << " lang=\"" << modlocale << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -331,16 +357,14 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ": ";
}
*output << text;
- if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << "</font>";
+ if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+ *output << "</span>";
}
else if (outputformat == FMT_RTF) {
*output << "}";
}
- *output << "(";
- *output << target->getName();
- *output << ")\n";
+ *output << "(" << target->getName() << ")\n";
}
if (outputformat == FMT_RTF) {
@@ -371,7 +395,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ";}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}}";
}
else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
- *output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
+ *output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
+ " lang=\"" << locale << "\" xml:lang=\"" << locale << "\"/>";
}
for (i = 0; i < listkey.getCount() && maxverses; i++) {
@@ -381,10 +406,14 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*parser = element->getUpperBound();
while (maxverses && *target->getKey() <= *parser) {
*output << (char*)target->getKeyText();
+ if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+ *output << ": <span ";
+ if (font) { *output << "style=\"font:\"" << font << ";\" " ;}
+ if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+ *output << ">";
+ }
if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << ": <font face=\"";
- *output << font;
- *output << "\">";
+ *output << ": <span style=\"font:\"" << font << ";\"" << " lang=\"" << modlocale << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -393,8 +422,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ": ";
}
*output << target->renderText();
- if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << "</font>";
+ if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+ *output << "</span>";
}
else if (outputformat == FMT_RTF) {
*output << "}";
@@ -420,10 +449,16 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
else {
target->setKey(*listkey.getElement(i));
*output << (char*)target->getKeyText();
+ if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+ *output << ": <span ";
+ if (font) { *output << "style=\"font:\"" << font << ";\" " ;}
+ if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+ *output << ">";
+ }
+ }
+
if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << ": <font face=\"";
- *output << font;
- *output << "\">";
+ *output << ": <font face=\"" << font << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -432,8 +467,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ": ";
}
*output << target->renderText();
- if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << "</font>";
+ if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+ *output << "</span>";
}
else if (outputformat == FMT_RTF) {
*output << "}";
@@ -452,7 +487,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
maxverses--;
}
}
-
+
+
*output << "(";
*output << target->getName();
*output << ")\n";
@@ -462,6 +498,4 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
}
}
- delete parser;
-}
diff --git a/utilities/diatheke/corediatheke.h b/utilities/diatheke/corediatheke.h
index 833825e..cac0845 100644
--- a/utilities/diatheke/corediatheke.h
+++ b/utilities/diatheke/corediatheke.h
@@ -2,7 +2,7 @@
*
* corediatheke.h -
*
- * $Id: corediatheke.h 2900 2013-07-16 07:48:52Z chrislit $
+ * $Id: corediatheke.h 3189 2014-04-17 05:00:28Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -30,6 +30,7 @@
#include "diathekemgr.h"
#include <localemgr.h>
+#include <swlocale.h>
#define QT_BIBLE 1
#define QT_COMM 2
@@ -62,6 +63,11 @@
#define ST_REGEX 1 // 0
#define ST_PHRASE 2 // -1
#define ST_MULTIWORD 3 // -2
+#define ST_ENTRYATTRIB 4 // -3
+#define ST_CLUCENE 5 // -4
+#define ST_MULTILEMMA 6 // -5
+
+
using namespace std;
diff --git a/utilities/diatheke/diatheke.cpp b/utilities/diatheke/diatheke.cpp
index 159e3a5..1649169 100644
--- a/utilities/diatheke/diatheke.cpp
+++ b/utilities/diatheke/diatheke.cpp
@@ -2,9 +2,9 @@
*
* diatheke.cpp -
*
- * $Id: diatheke.cpp 2903 2013-07-16 11:11:18Z chrislit $
+ * $Id: diatheke.cpp 3170 2014-04-17 04:14:38Z greg.hellings $
*
- * Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1999-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -21,7 +21,7 @@
*/
/******************************************************************************
- * Diatheke 4.6 by Chris Little <chrislit@crosswire.org>
+ * Diatheke 4.7 by Chris Little <chrislit@crosswire.org>
* http://www.crosswire.org/sword/diatheke
*/
@@ -37,8 +37,8 @@ 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.6\n");
- fprintf (stderr, "Copyright 1999-2013 by the CrossWire Bible Society\n");
+ fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.7\n");
+ fprintf (stderr, "Copyright 1999-2014 by the CrossWire Bible Society\n");
fprintf (stderr, "http://www.crosswire.org/sword/diatheke/\n");
fprintf (stderr, "\n");
fprintf (stderr, "usage: diatheke <-b module_name> [-s search_type] [-r search_range]\n");
@@ -49,8 +49,9 @@ void printsyntax() {
fprintf (stderr, "If <book> is \"system\" you may use these system keys: \"modulelist\",\n");
fprintf (stderr, "\"modulelistnames\", and \"localelist\".");
fprintf (stderr, "\n");
- fprintf (stderr, "Valid search_type values are: regex, multiword, and phrase(def).\n");
- fprintf (stderr, "Valid option_filters values are: n (Strong's numbers),\n");
+ fprintf (stderr, "Valid search_type values are: phrase (default), regex, multiword,\n");
+ fprintf (stderr, " attribute, lucene, multilemma.\n");
+ fprintf (stderr, "Valid (output) option_filters values are: n (Strong's numbers),\n");
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");
@@ -70,6 +71,8 @@ void printsyntax() {
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");
fprintf (stderr, " diatheke -b KJV -s phrase -r Mt -k love\n");
+
+ exit(EXIT_FAILURE);
}
int main(int argc, char **argv)
@@ -94,19 +97,30 @@ int main(int argc, char **argv)
}
else if (!::stricmp("-s", argv[i])) {
if (i+1 <= argc) {
- if (!::stricmp("phrase", argv[i+1])) {
+ i++;
+ if (!::stricmp("phrase", argv[i])) {
searchtype = ST_PHRASE;
- i++;
}
- else if (!::stricmp("regex", argv[i+1])) {
+ else if (!::stricmp("regex", argv[i])) {
searchtype = ST_REGEX;
- i++;
}
- else if (!::stricmp("multiword", argv[i+1])) {
+ else if (!::stricmp("multiword", argv[i])) {
searchtype = ST_MULTIWORD;
- i++;
}
- else i++;
+ else if (!::stricmp("lucene", argv[i])) {
+ searchtype = ST_CLUCENE;
+ }
+ else if (!::stricmp("attribute", argv[i])) {
+ searchtype = ST_ENTRYATTRIB;
+ }
+ else if (!::stricmp("multilemma", argv[i])) {
+ searchtype = ST_MULTILEMMA;
+ }
+ else {
+ fprintf (stderr, "Unknown search_type: %s\n", argv[i]);
+ fprintf (stderr, "Try diatheke --help\n");
+ return 0;
+ }
}
}
else if (!::stricmp("-r", argv[i])) {
@@ -233,8 +247,11 @@ int main(int argc, char **argv)
if (i < argc) {
SWBuf key = argv[i];
i++;
- for (; i < argc; i++)
+ for (; i < argc; i++) {
+ if (!::stricmp("-h", argv[i]) || !::stricmp("--help", argv[i]))
+ printsyntax();
key = key + " " + argv[i];
+ }
ref = new char[key.length() + 1];
strcpy (ref, key.c_str());
if (strlen(ref))
@@ -257,12 +274,18 @@ int main(int argc, char **argv)
}
}
*/
+ else {
+ // unexpected argument, so print the syntax
+ // -h, --help, /?, etc. will trigger this
+ printsyntax();
+ }
}
if (runquery == (RQ_BOOK | RQ_REF)) {
doquery(maxverses, outputformat, outputencoding, optionfilters, searchtype, range, text, locale, ref, &cout, script, variants);
}
+ //if we got this far without exiting, something went wrong, so print syntax
else printsyntax();
return 0;
diff --git a/utilities/diatheke/diathekemgr.cpp b/utilities/diatheke/diathekemgr.cpp
index a64b570..aa79fcf 100644
--- a/utilities/diatheke/diathekemgr.cpp
+++ b/utilities/diatheke/diathekemgr.cpp
@@ -2,7 +2,7 @@
*
* diathekemgr.cpp - DiathekeMgr
*
- * $Id: diathekemgr.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: diathekemgr.cpp 3167 2014-04-17 04:12:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -76,13 +76,14 @@ DiathekeMgr::~DiathekeMgr()
void DiathekeMgr::AddRenderFilters(SWModule *module, ConfigEntMap &section)
{
SWBuf lang;
- bool rtl;
ConfigEntMap::iterator entry;
lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (SWBuf)"en";
- rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
#ifdef _ICU_
+ bool rtl;
+ rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
+
if (shape) {
module->addRenderFilter(arshaping);
}
diff --git a/utilities/osis2mod.cpp b/utilities/osis2mod.cpp
index eab2ee0..b8514b1 100644
--- a/utilities/osis2mod.cpp
+++ b/utilities/osis2mod.cpp
@@ -2,9 +2,9 @@
*
* osis2mod.cpp - Utility to import a module in OSIS format
*
- * $Id: osis2mod.cpp 2893 2013-07-16 03:07:02Z scribe $
+ * $Id: osis2mod.cpp 3177 2014-04-17 04:24:37Z greg.hellings $
*
- * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -414,10 +414,10 @@ bool isValidRef(const char *buf) {
*/
void makeValidRef(VerseKey &key) {
VerseKey saveKey;
- saveKey.setVersificationSystem(currentVerse.getVersificationSystem());
+ saveKey.setVersificationSystem(key.getVersificationSystem());
saveKey.setAutoNormalize(false);
saveKey.setIntros(true);
- saveKey = currentVerse;
+ saveKey = key;
// Since isValidRef returned false constrain the key to the nearest prior reference.
// If we are past the last chapter set the reference to the last chapter
@@ -465,7 +465,7 @@ void makeValidRef(VerseKey &key) {
void writeEntry(SWBuf &text, bool force = false) {
char keyOsisID[255];
- static const char* revision = "<milestone type=\"x-importer\" subType=\"x-osis2mod\" n=\"$Rev: 2893 $\"/>";
+ static const char* revision = "<milestone type=\"x-importer\" subType=\"x-osis2mod\" n=\"$Rev: 3177 $\"/>";
static bool firstOT = true;
static bool firstNT = true;
@@ -528,8 +528,9 @@ void writeEntry(SWBuf &text, bool force = false) {
// If the entry already exists, then append this entry to the text.
// This is for verses that are outside the chosen versification. They are appended to the prior verse.
// The space should not be needed if we retained verse tags.
- SWBuf currentText = module->getRawEntry();
- if (currentText.length()) {
+ if (module->hasEntry(&currentVerse)) {
+ module->flush();
+ SWBuf currentText = module->getRawEntry();
cout << "INFO(WRITE): Appending entry: " << currentVerse.getOSISRef() << ": " << activeVerseText << endl;
activeVerseText = currentText + " " + activeVerseText;
}
@@ -1140,7 +1141,7 @@ bool handleToken(SWBuf &text, XMLTag token) {
* requiring each stored entry (i.e. verses) to be well-formed xml.
* This routine normalizes container elements which could cross verse boundaries into milestones.
* For most of these OSIS elements, there is a milestone form. However, p is not milestoneable.
- * For this reason, p is transformed into lb elements.
+ * For this reason, p is transformed into div elements with type x-p.
* param t the tag to transform
* return the transformed tag or the original one
*/
@@ -1161,9 +1162,9 @@ XMLTag transformBSP(XMLTag t) {
SWBuf tagName = t.getName();
if (!t.isEndTag()) {
- // Transform <p> into <div type="paragraph"> and milestone it
+ // Transform <p> into <div type="x-p"> and milestone it
if (tagName == "p") {
- t.setText("<div type=\"paragraph\" />");
+ t.setText("<div type=\"x-p\" />");
sprintf(buf, "gen%d", sID++);
t.setAttribute("sID", buf);
}
@@ -1222,7 +1223,7 @@ XMLTag transformBSP(XMLTag t) {
tagName == "verse"
) {
// make this a clone of the start tag with sID changed to eID
- // Note: in the case of </p> the topToken is a <div type="paragraph">
+ // Note: in the case of </p> the topToken is a <div type="x-p">
t = topToken;
t.setAttribute("eID", t.getAttribute("sID"));
t.setAttribute("sID", 0);
@@ -1277,10 +1278,10 @@ void writeLinks()
}
}
-void usage(const char *app, const char *error = 0) {
-
+void usage(const char *app, const char *error = 0, const bool verboseHelp = false) {
+
if (error) fprintf(stderr, "\n%s: %s\n", app, error);
-
+
fprintf(stderr, "OSIS Bible/commentary module creation tool for The SWORD Project\n");
fprintf(stderr, "\nusage: %s <output/path> <osisDoc> [OPTIONS]\n", app);
fprintf(stderr, " <output/path>\t\t an existing folder that the module will be written\n");
@@ -1293,37 +1294,57 @@ void usage(const char *app, const char *error = 0) {
fprintf(stderr, "\t\t\t\t 2 - verse; 3 - chapter; 4 - book\n");
fprintf(stderr, " -c <cipher_key>\t encipher module using supplied key\n");
fprintf(stderr, "\t\t\t\t (default no enciphering)\n");
+
+#ifdef _ICU_
fprintf(stderr, " -N\t\t\t do not convert UTF-8 or normalize UTF-8 to NFC\n");
- fprintf(stderr, "\t\t\t\t (default is to convert to UTF-8, if needed,\n");
- fprintf(stderr, "\t\t\t\t and then normalize to NFC)\n");
- fprintf(stderr, "\t\t\t\t Note: UTF-8 texts should be normalized to NFC.\n");
+ if (verboseHelp) {
+ fprintf(stderr, "\t\t\t\t (default is to convert to UTF-8, if needed,\n");
+ fprintf(stderr, "\t\t\t\t and then normalize to NFC)\n");
+ fprintf(stderr, "\t\t\t\t Note: UTF-8 texts should be normalized to NFC.\n");
+ }
+#endif
+
fprintf(stderr, " -s <2|4>\t\t bytes used to store entry size (default is 2).\n");
- fprintf(stderr, "\t\t\t\t Note: useful for commentaries with very large\n");
- fprintf(stderr, "\t\t\t\t entries in uncompressed modules\n");
- fprintf(stderr, "\t\t\t\t (2 bytes to store size equal 65535 characters)\n");
+ if (verboseHelp) {
+ fprintf(stderr, "\t\t\t\t Note: useful for commentaries with very large\n");
+ fprintf(stderr, "\t\t\t\t entries in uncompressed modules\n");
+ fprintf(stderr, "\t\t\t\t (2 bytes to store size equal 65535 characters)\n");
+ }
fprintf(stderr, " -v <v11n>\t\t specify a versification scheme to use (default is KJV)\n");
- fprintf(stderr, "\t\t\t\t Note: The following are valid values for v11n:\n");
+ fprintf(stderr, "\t\t\t\t Note: The following are valid values for v11n:");
+
VersificationMgr *vmgr = VersificationMgr::getSystemVersificationMgr();
StringList av11n = vmgr->getVersificationSystems();
for (StringList::iterator loop = av11n.begin(); loop != av11n.end(); loop++) {
- fprintf(stderr, "\t\t\t\t\t%s\n", (*loop).c_str());
+ if ((distance(av11n.begin(), loop) % 3) == 0) {
+ fprintf(stderr, "\n\t\t\t\t %-12s", (*loop).c_str());
+ }
+ else {
+ fprintf(stderr, "\t%-12s", (*loop).c_str());
+ }
}
- fprintf(stderr, " -d <flags>\t\t turn on debugging (default is 0)\n");
- fprintf(stderr, "\t\t\t\t Note: This flag may change in the future.\n");
- fprintf(stderr, "\t\t\t\t Flags: The following are valid values:\n");
- fprintf(stderr, "\t\t\t\t\t0 - no debugging\n");
- fprintf(stderr, "\t\t\t\t\t1 - writes to module, very verbose\n");
- fprintf(stderr, "\t\t\t\t\t2 - verse start and end\n");
- fprintf(stderr, "\t\t\t\t\t4 - quotes, esp. Words of Christ\n");
- fprintf(stderr, "\t\t\t\t\t8 - titles\n");
- fprintf(stderr, "\t\t\t\t\t16 - inter-verse material\n");
- fprintf(stderr, "\t\t\t\t\t32 - BSP to BCV transformations\n");
- fprintf(stderr, "\t\t\t\t\t64 - v11n exceptions\n");
- fprintf(stderr, "\t\t\t\t\t128 - parsing of osisID and osisRef\n");
- fprintf(stderr, "\t\t\t\t\t256 - internal stack\n");
- fprintf(stderr, "\t\t\t\t\t512 - miscellaneous\n");
- fprintf(stderr, "\t\t\t\t This argument can be used more than once. (Or\n");
- fprintf(stderr, "\t\t\t\t the flags may be added together.)\n");
+ fprintf(stderr, "\n");
+
+ if (verboseHelp) {
+ fprintf(stderr, " -d <flags>\t\t turn on debugging (default is 0)\n");
+ fprintf(stderr, "\t\t\t\t Note: This flag may change in the future.\n");
+ fprintf(stderr, "\t\t\t\t Flags: The following are valid values:\n");
+ fprintf(stderr, "\t\t\t\t\t0 - no debugging\n");
+ fprintf(stderr, "\t\t\t\t\t1 - writes to module, very verbose\n");
+ fprintf(stderr, "\t\t\t\t\t2 - verse start and end\n");
+ fprintf(stderr, "\t\t\t\t\t4 - quotes, esp. Words of Christ\n");
+ fprintf(stderr, "\t\t\t\t\t8 - titles\n");
+ fprintf(stderr, "\t\t\t\t\t16 - inter-verse material\n");
+ fprintf(stderr, "\t\t\t\t\t32 - BSP to BCV transformations\n");
+ fprintf(stderr, "\t\t\t\t\t64 - v11n exceptions\n");
+ fprintf(stderr, "\t\t\t\t\t128 - parsing of osisID and osisRef\n");
+ fprintf(stderr, "\t\t\t\t\t256 - internal stack\n");
+ fprintf(stderr, "\t\t\t\t\t512 - miscellaneous\n");
+ fprintf(stderr, "\t\t\t\t This argument can be used more than once. (Or\n");
+ fprintf(stderr, "\t\t\t\t the flags may be added together.)\n");
+ }
+ fprintf(stderr, " -h \t\t\t print verbose usage text\n");
+
fprintf(stderr, "\n");
fprintf(stderr, "See http://www.crosswire.org/wiki/osis2mod for more details.\n");
fprintf(stderr, "\n");
@@ -1531,7 +1552,15 @@ void processOSIS(istream& infile) {
int main(int argc, char **argv) {
- fprintf(stderr, "You are running osis2mod: $Rev: 2893 $\n");
+ fprintf(stderr, "You are running osis2mod: $Rev: 3177 $\n");
+
+ if (argc > 1) {
+ for (int i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
+ usage(*argv, "", true);
+ }
+ }
+ }
// Let's test our command line arguments
if (argc < 3) {