~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

Refreshing from mainline branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
376
376
void close_connections(void);
377
377
 
378
378
po::options_description long_options("Allowed Options");
 
379
po::variables_map vm;
 
380
 
 
381
po::variables_map &getVariablesMap()
 
382
{
 
383
  return vm;
 
384
}
379
385
 
380
386
/****************************************************************************
381
387
** Code to end drizzled
866
872
    unireg_abort(1);
867
873
  }
868
874
 
 
875
 
869
876
  if (opt_help || opt_help_extended)
870
877
    unireg_abort(0);
871
878
 
 
879
  po::parsed_options parsed= po::command_line_parser(defaults_argc,
 
880
                                                     defaults_argv).
 
881
    options(long_options).allow_unregistered().run();
 
882
 
 
883
  vector<string> unknown_options=
 
884
    po::collect_unrecognized(parsed.options, po::include_positional);
 
885
 
872
886
  /* we do want to exit if there are any other unknown options */
873
 
  if (defaults_argc > 1)
 
887
  /** @TODO: We should perhaps remove allowed_unregistered() and catch the
 
888
    exception here */
 
889
  if (unknown_options.size() > 0)
874
890
  {
875
 
    int ho_error;
876
 
    char **tmp_argv= defaults_argv;
877
 
    struct option no_opts[]=
878
 
    {
879
 
      {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
880
 
    };
881
 
    /*
882
 
      We need to eat any 'loose' arguments first before we conclude
883
 
      that there are unprocessed options.
884
 
      But we need to preserve defaults_argv pointer intact for
885
 
      internal::free_defaults() to work. Thus we use a copy here.
886
 
    */
887
 
    my_getopt_skip_unknown= 0;
888
 
 
889
 
    if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts,
890
 
                                  drizzled_get_one_option)))
891
 
      unireg_abort(ho_error);
892
 
 
893
 
    if (defaults_argc)
894
 
    {
895
 
      fprintf(stderr,
896
 
              _("%s: Too many arguments (first extra is '%s').\n"
897
 
                "Use --verbose --help to get a list of available options\n"),
898
 
              internal::my_progname, *tmp_argv);
 
891
     fprintf(stderr,
 
892
            _("%s: Too many arguments (first extra is '%s').\n"
 
893
              "Use --verbose --help to get a list of available options\n"),
 
894
            internal::my_progname, unknown_options[0].c_str());
899
895
      unireg_abort(1);
900
 
    }
901
896
  }
902
897
 
 
898
  po::store(parsed, vm);
 
899
  po::notify(vm);
 
900
 
903
901
  string scheduler_name;
904
902
  if (opt_scheduler)
905
903
  {