]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp
*** empty log message ***
[bbtk.git] / kernel / appli / bbRegeneratePackageDoc / bbRegeneratePackageDoc.cpp
index bcbae90610659c486f75913e95133497bcb01624..9faa7d56b429a860da732a44964672510b24ddca 100644 (file)
@@ -7,27 +7,36 @@
 //==========================================================================
 void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path )
 {
-       std::string pack_name(p->GetName());
-       std::string pack_path = doc_path + pack_name;
-       // Creating directory
-       if ( ! bbtk::Utilities::FileExists(pack_path) )
-       {
-               std::string command("mkdir \"" +pack_path+ "\"");
-               system( command.c_str() );
-       }
-       std::string pack_index(pack_path);
-       pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
-       pack_index += "index.html";
-
-       std::cout << "* Generating doc for package '"<<pack_name<<"' in "
-                         << pack_index << std::endl;
-                       
-       p->SetDocURL(pack_index);
-       p->SetDocRelativeURL("index.html");
-       p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true);
+  std::string pack_name(p->GetName());
+  std::string pack_path = doc_path + pack_name;
+  // Creating directory
+  if ( ! bbtk::Utilities::FileExists(pack_path) )
+    {
+      std::string command("mkdir \"" +pack_path+ "\"");
+      system( command.c_str() );
+    }
+  std::string pack_index(pack_path);
+  pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+  pack_index += "index.html";
+  
+  std::cout << "* Generating doc for package '"<<pack_name<<"' in "
+           << pack_index << std::endl;
+  
+  p->SetDocURL(pack_index);
+  p->SetDocRelativeURL("index.html");
+  p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true);
 }
 
 
+void Usage()
+{
+  std::cout << "usage : bbRegeneratePackageDoc [<package name>|-a] [-q|-v]" 
+           << std::endl
+           << "        -a : All packages"<<std::endl
+           << "        -q : Quiet"<<std::endl
+           << "        -v : Verbose"<<std::endl;
+}
+
 //==========================================================================
 int main(int argc, char **argv)
 {
@@ -39,11 +48,18 @@ int main(int argc, char **argv)
   else if (argc==3)
     {
       pack = std::string(argv[1]);
-      bbtk::MessageManager::SetMessageLevel("max",0);
+      std::string param(argv[2]);
+      if (param=="-q") bbtk::MessageManager::SetMessageLevel("max",0);
+      else if (param=="-v") bbtk::MessageManager::SetMessageLevel("all",9);
+      else 
+       {
+         Usage();
+         return 0;
+       }
     }
   else 
     {
-      std::cout << "usage : bbRegeneratePackageDoc [<package name>|-a] [-quiet]" << std::endl;
+      Usage();
       return 0;
     }