+ if (args.verbose_given) g.SetMessageLevel(args.verbose_arg);
+ if (args.debug_given) g.SetDebugMessageLevel(args.debug_arg);
+
+ bool something_to_do =
+ args.dir_given |
+ args.file_given |
+ args.print_given;
+
+ if (!something_to_do)
+ {
+ std::cout << "Nothing to do !" << std::endl;
+ return 0;
+ }
+
+ std::string handler("Local database");
+ try
+ {
+ g.Initialize();
+
+ if (args.file_given)
+ {
+ std::vector<std::string> files;
+ // TO DO : multiple files given
+ files.push_back(args.file_arg);
+ g.AddFiles(handler,files);
+ }
+ if (args.dir_given)
+ {
+ g.AddDir(handler,args.dir_arg, args.recurse_given);
+ }
+
+ if (args.print_given)
+ {
+ g.GetTreeHandler(handler)->LoadChildren(0,0);
+ g.Print(handler);
+ }
+
+ g.Finalize();
+ }
+ catch (crea::Exception e)
+ {
+ e.Print();
+ }
+