aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bible.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bible.cc b/src/bible.cc
index a09c0c0..4da2326 100644
--- a/src/bible.cc
+++ b/src/bible.cc
@@ -31,7 +31,19 @@ void usage() {
}
string getDefaultModule() {
- return libbible::settingsRead("module");
+ map<string, vector<string>> mods = libbible::getModules();
+ string mod = libbible::settingsRead("module");
+ if(mods.count(mod) > 0) {
+ return mod;
+ }
+ if(!mods.empty()) {
+ // Just get one
+ for(auto pair : mods) {
+ return pair.first.c_str();
+ }
+ }
+ printf("ERROR: No mods installed!\n");
+ exit(1);
}
void listModules() {