X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fappli%2Fbbi%2Fbbi.cxx;h=5404d6ed728a4ba44742118a2cb544df780288f8;hb=6c61e1295d4bedbd7b5abdb256173a2d6df80423;hp=39fcc08b5026c5cb737886af15636ab42d95f9a0;hpb=5ca30b861f60def2666a1c675e8b45df0a713f95;p=bbtk.git diff --git a/kernel/appli/bbi/bbi.cxx b/kernel/appli/bbi/bbi.cxx index 39fcc08..5404d6e 100644 --- a/kernel/appli/bbi/bbi.cxx +++ b/kernel/appli/bbi/bbi.cxx @@ -14,6 +14,7 @@ static const wxCmdLineEntryDesc cmdLineDesc[] = { + { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("Debug messages on (message All 9)") }, { wxCMD_LINE_SWITCH, _T("c"), _T("command"), _T("turn to command line mode after file(s) processing") }, { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"), _T("be quiet") }, { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("print help") }, @@ -41,6 +42,7 @@ public: int argc; std::vector argv; bool command; + bool debug; bool quiet; bool help; bool graphical_dialog; @@ -62,6 +64,7 @@ void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser) bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser) { + debug = ( parser.Found(_T("d")) ); quiet = ( parser.Found(_T("q")) ); help = ( parser.Found(_T("h")) ); graphical_dialog = ( parser.Found(_T("g")) ); @@ -120,9 +123,12 @@ bool wxBBIApp::OnInit( ) //See http://www.wxwindows.org/faqgtk.htm#locale setlocale(LC_NUMERIC, "C"); #endif + + if (quiet) bbtk::MessageManager::SetMessageLevel("All",0); + if (debug) bbtk::MessageManager::SetMessageLevel("All",9); + - - bbtk::WxConsole *I = new bbtk::WxConsole(0,_T("bbi"),wxSize(600,400)); + bbtk::WxConsole *I = new bbtk::WxConsole(0,_T("bbi"),wxSize(800,600)); SetTopWindow(I); if (!no_command) I->Show(true); @@ -138,8 +144,11 @@ bool wxBBIApp::OnInit( ) for (i=input_file.begin(); i!=input_file.end(); ++i) I->InterpretFile(*i); I->SetNoExecMode(false); - if (help_on_script) bbtk::HelpBlackBox("workspace",false); - + if (help_on_script) + { + std::string package; + I->GetInterpreter()->GetExecuter()->GetFactory()->HelpBlackBox("workspace",package,false); + } if (!(command || bbtk::Wx::IsSomeWindowShown() )) { I->Close();