diff --git a/include/openbabel/plugin.h b/include/openbabel/plugin.h index 3714227981..857cd9d409 100644 --- a/include/openbabel/plugin.h +++ b/include/openbabel/plugin.h @@ -124,6 +124,9 @@ class OBERROR OBPlugin ///Returns the map of the subtypes virtual PluginMapType& GetMap() const =0; + ///Load all plugins (formats, fingerprints, forcefields etc.) + static void LoadAllPlugins(); + protected: ///\brief Returns a reference to the map of the plugin types. /// Is a function rather than a static member variable to avoid initialization problems. @@ -136,9 +139,6 @@ class OBERROR OBPlugin ///Keep a record if all plugins have been loaded static int AllPluginsLoaded; - ///Load all plugins (formats, fingerprints, forcefields etc.) - static void LoadAllPlugins(); - ///Returns the map of a particular plugin type, e.g. GetMapType("fingerprints") static PluginMapType& GetTypeMap(const char* PluginID); diff --git a/src/formats/fastsearchformat.cpp b/src/formats/fastsearchformat.cpp index 7fb7b9cf90..0b305a6f95 100644 --- a/src/formats/fastsearchformat.cpp +++ b/src/formats/fastsearchformat.cpp @@ -541,6 +541,13 @@ virtual const char* Description() //required vector vec; tokenize(vec, p); + if(vec.size() == 0) + { + obErrorLog.ThrowError(__FUNCTION__, + "Missing argument for -s/-S", obError); + return false; + } + //ignore leading ~ (not relevant to fastsearch) if(vec[0][0]=='~') vec[0].erase(0,1); diff --git a/tools/babel.cpp b/tools/babel.cpp index 049c24d51e..4e2cb698d5 100644 --- a/tools/babel.cpp +++ b/tools/babel.cpp @@ -73,6 +73,9 @@ int main(int argc,char *argv[]) char *oext = NULL; char *iext = NULL; + //load plugs to fully initialize option parameters + OBPlugin::LoadAllPlugins(); + //Save name of program without its path (and .exe) string pn(argv[0]); string::size_type pos;