[sword-devel] diatheke was su

Chris Little sword-devel@crosswire.org
Thu, 8 Feb 2001 17:57:48 -0800



> Cool. But then if I try something like:
>
> ./diatheke kjv John 3:16
>
> I get:
>
> Segmentation fault (core dumped)

The fact that it dies with a core dump is bad and entirely my fault.  I
should (and promise that I will, eventually) make it die more gracefully.

In this case, however, it would still die because there are a couple
problems with the syntax you're using there.

First, you need to specify the kind of query you're performing.  In this
case, it's a Bible query, so you need to use the -b switch.  BTW, the -b
and -c switches are completely interchangeable--diatheke doesn't know the
difference between a Bible and a commentary.  Second, you have to specify
the name of the module exactly as it is named in the conf files, and it is
case sensitive.  So you'd use KJV where you have kjv.  Third, the verse
argument has to be a single argument, meaning no whitespace or it needs to
be in quotes.  You could either type John3:16 or "John 3:16" here.

So, to recap, the properly formed command would be:
./diatheke -b KJV John3:16

It is printed in ThML by default, so if you want plaintext, it would be:
./diatheke -b KJV John3:16 plaintext

And if, for example, you had diatheke connected to a script where anyone
could feed verse ranges into it, but you wanted to limit the number of
quotable verses per query, you can add a fifth argument.  For example,
someone might query Genesis 1:1 - Revelation 22:21, but if you were limiting
it to 10 verses per query, you would form the command:
./diatheke -b KJV "Genesis 1:1 - Revelation 22:21" thml 50

> Maybe it is not finding my modules. How do I know where to put
> them? And how
> do I tell diatheke where to look? Do I need to append all the *.conf files
> into the mods.conf? Or do I put a mods.d directory in my
> /cgi-bin/ or along
> side of it? I could probably try all night with different
> combinations, so I
> figured I'd just ask instead.

If the above do not work, and you're still getting a core dump, then
diatheke is probably unable to find your modules.  You can put them
anywhere, so long as the SWORD_PATH environment variable is set to that
directory.  For example, if your modules and mods.d directories are in
/home/mydirectory, SWORD_PATH needs to be set to /home/mydirectory.  You
don't need to copy the conf files to mods.conf--that's the old configuration
format.  When you set up the CGI script, there is a variable at the top of
the main PERL file where you need to set SWORD_PATH also.

--Chris