+
+ debug = ( Found("d") );
+ quiet = ( Found("q") );
+ help = ( Found("h") );
+ graphical_dialog = ( Found("g") );
+ text_dialog = ( Found("t") );
+ no_console = ( Found("N") );
+
+ if (quiet) bbtk::MessageManager::SetMessageLevel("max",0);
+ if (debug) bbtk::MessageManager::SetMessageLevel("all",9);
+
+ // parse the arguments and consider those which contain a "="
+ // as set input commands, other as files
+//EED int pargc = parser.GetParamCount();
+ for (int i=1; i<argc; ++i)
+ {
+ std::string s = argv[i];
+ std::string::size_type pos = s.find_first_of("=");
+ if (std::string::npos != pos)
+ {
+ std::string left = s.substr(0,pos);
+ std::string right = s.substr(pos+1,s.size());
+ param_map[left]=right;
+ }
+ else
+ {
+ input_file.push_back(s);
+ }
+ }// for
+
+ bool usage = (help && (input_file.size()==0));
+ if (usage) {
+ std::cout << "BBI (The Black Box Interpreter) - bbtk "
+ << bbtk::GetVersion() << " - (c) Creatis 2007-2008"
+ << std::endl;
+//EED parser.Usage();
+ proceed = false;
+ }
+
+ console = ( Found("c") ||
+ ((input_file.size() == 0) &&
+ (!no_console) &&
+ (!usage) ) );
+
+}
+//==========================================================================
+
+
+
+int main(int argc, char* argv[])
+{
+//EED
+// if (argc>2)
+// {
+// std::cout << "usage : "<<argv[0]<<" [filename]"<<std::endl;
+// return 0;
+// }
+
+ std::cout << "BBI (Black Box Interpreter) - bbtk "
+ << bbtk::GetVersion()<< " - (c) Creatis 2007"
+ << std::endl;
+
+ bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
+ if (argc==1)
+ {
+ I->CommandLineInterpreter();
+ } else {
+
+ ProcessCmdLine cmd;
+ cmd.Process(argc,argv);
+ I->SetInputs(cmd.param_map);
+
+ std::string f(argv[1]);
+ I->InterpretFile(f);
+ }
+
+ // bbtk::Wx::LoopUntilAllWindowsClose();
+