+
+ //Describes third group of options
+ po::options_description option("OPTIONS");
+ option.add_options()
+ ("verbose,v",po::value<int>(&verb),"Verbosity level (default=`1')")
+ ("debug,D",po::value<int>(&deb),"Debug messages level (default=`0')");
+
+ //Adds the groups into a big one
+ po::options_description cmdline_options;
+ cmdline_options.add(generic).add(command).add(option);
+
+ //Adds the corresponding variables
+ po::variables_map vm;
+ po::store(po::parse_command_line(ac, av, cmdline_options), vm);
+ po::notify(vm);
+
+ //Does something on each option
+ //GENERIC
+ if (vm.count("help")) {
+ cout << "Usage: gimmick COMMAND [OPTIONS]:\n";
+ cout << cmdline_options << "\n";
+ }
+ if (vm.count("version")) {
+ cout << "gimmick 0.1.0\n";
+ }
+
+ //OPTIONS
+ if (vm.count("verbose")) {
+ g.SetMessageLevel(verb);
+ cout << "Verbose level is now "<<verb<<"\n";
+ }
+ if (vm.count("debug")) {
+ g.SetDebugMessageLevel(deb);
+ cout << "Debug level is now "<<deb<<"\n";
+ }
+
+ //COMMANDS
+ if ( vm.count("print")
+ ||vm.count("file")
+ ||vm.count("dir")
+ ||vm.count("sync")
+ )