]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbi/bbi.cxx
*** empty log message ***
[bbtk.git] / kernel / appli / bbi / bbi.cxx
index 42d5ec54c25d2310b3aab45f5f92d610512bfebe..378c1f63eda4cfbefb1c229355b0b0dc7a3c7fbb 100644 (file)
 
 static const wxCmdLineEntryDesc cmdLineDesc[] =
 {
-  { wxCMD_LINE_SWITCH, _T("M"), _T("Memory debug"), _T("Display memory debug message on exit ('object -S')") },
-  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("all messages on ('message all 9')") },
-  { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open a console") },
-  { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet ('message max 0')") },
-  { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print help on bbi or on workspace defined if any") },
-  { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"),   _T("prompts the user for the parameter values using graphical dialog") },
-  { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"),   _T("prompts the user for the parameter values in text mode") },
-  { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"),   _T("do not show console (even on error)") },
-  { wxCMD_LINE_PARAM,  NULL, NULL, _T("input_file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+  { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print this help or help on the application defined in input bbs file if any") },
+  { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"),   _T("prompt the input parameter values using graphical dialog") },
+  { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"),   _T("prompt the input parameter values in text mode") },
+  { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open bbi console") },
+  { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"),   _T("never open bbi console even on error") },
+  { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet (='message max 0')") },
+  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("turn all messages on (='message all 9')") },
+  { wxCMD_LINE_SWITCH, _T("D"), _T("Debug"), _T("memory debug on exit (='debug -D')") },
+  { wxCMD_LINE_PARAM,  NULL, NULL, _T("file [file [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
   { wxCMD_LINE_NONE }
 };
 
@@ -67,12 +67,14 @@ void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
 
 bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
 {
-  if (parser.Found(_T("M"))) 
+
+  if (parser.Found(_T("D"))) 
     {
       bbtk::StaticInitTime::PrintObjectListInfo = true;
     }
   
   debug = ( parser.Found(_T("d")) );
+
   quiet = ( parser.Found(_T("q")) );
   help = ( parser.Found(_T("h")) );
   graphical_dialog = ( parser.Found(_T("g")) );
@@ -172,9 +174,19 @@ bool wxBBIApp::OnInit( )
       I->GetInterpreter()->GetExecuter()->GetFactory()->HelpBlackBox("workspace",package,false);
     }
 
+  /*
+  std::cout << "soe="<<show_on_error <<std::endl;
+  std::cout << "con="<<console<<std::endl;
+  std::cout << "iws="<<bbtk::Wx::IsSomeWindowShown()<<std::endl;
+  */
   if (!(show_on_error || console || bbtk::Wx::IsSomeWindowShown() ))
     {
       I->Close();
+      //      std::cout << "I->Close"<<std::endl;
+    }
+  else 
+    {
+      //      std::cout << "!I->Close"<<std::endl;
     }
   return true;