+ if (args.verbose_given) g.SetMessageLevel(args.verbose_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;
+ exit(0);
+ }
+
+ try
+ {
+ if (!g.Initialize()) return 1;
+
+ if (args.file_given)
+ {
+ g.AddFileToLocalDatabase(args.file_arg);
+ }
+ if (args.dir_given)
+ {
+ g.AddDirToLocalDatabase(args.dir_arg, args.recurse_given);
+ }
+
+ if (args.print_given)
+ {
+ g.GetLocalDatabase()->LoadChildren(0,0);
+ g.PrintLocalDatabase();
+ }
+
+ if (!g.Finalize()) return 1;
+ }
+ catch (crea::Exception e)
+ {
+ e.Print();
+ }