--- /dev/null
+
+#include <bbtkConfigurationFile.h>
+#include <bbtkUtilities.h>
+using namespace bbtk;
+//==========================================================================
+int main(int argc, char **argv)
+{
+ if (argc!=2)
+ {
+ std::cout << "usage : bbPlugPackage <path_to_package>" << std::endl;
+ return 0;
+ }
+
+ std::string path(argv[1]);
+ std::string fname = path + "/bbtkPackage";
+
+ if ( ! Utilities::FileExists( fname ) )
+ {
+ std::cout << "* ERROR : The directory '"<<path<<"' does not contain a 'bbtkPackage' file"
+ << std::endl;
+ return 1;
+ }
+
+ std::ifstream f;
+ f.open(fname.c_str());
+ std::string pname;
+ f >> pname;
+ f.close();
+
+
+ ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
+
+ std::string command;
+ command = ConfigurationFile::GetInstance().Get_bin_path();
+ command += ConfigurationFile::GetInstance().Get_file_separator();
+ command += "bbRegeneratePackageDoc " + pname + " -q && ";
+ command += ConfigurationFile::GetInstance().Get_bin_path();
+ command += ConfigurationFile::GetInstance().Get_file_separator();
+ command += "bbRegenerateBoxesLists -q ";
+
+ if ( ! system ( command.c_str() ) )
+ {
+ std::cout << "Package '"
+ << pname << "' successfully plugged in" << std::endl;
+ }
+ else
+ {
+ std::cout << "An error occured while running '"
+ << command << "'" << std::endl;
+ return 1;
+ }
+ return 0;
+}
+//==========================================================================
+
+