- static char *cf; /* config file */
- struct stat statbuf;
-
- version_handle_flag("filter", conf.version_given);
- if (conf.help_given || conf.detailed_help_given)
- print_help_and_die();
- if (!cf) {
- char *home = para_homedir();
- cf = make_message("%s/.paraslash/filter.conf", home);
- free(home);
- }
- if (!stat(cf, &statbuf)) {
- struct filter_cmdline_parser_params params = {
- .override = 0,
- .initialize = 0,
- .check_required = 0,
- .check_ambiguity = 0,
- .print_errors = 1
- };
- filter_cmdline_parser_config_file(cf, &conf, ¶ms);
- loglevel = get_loglevel_by_name(conf.loglevel_arg);
+ int ret;
+
+ version_handle_flag("filter", OPT_GIVEN(VERSION));
+ handle_help_flag();
+ ret = lsu_merge_config_file_options(NULL, "filter.conf",
+ &lpr, CMD_PTR, filter_suite, 0 /* default flags */);
+ if (ret < 0)
+ return ret;
+ loglevel = OPT_UINT32_VAL(LOGLEVEL);
+ if (!OPT_GIVEN(FILTER)) {
+ print_filter_list();
+ exit(EXIT_SUCCESS);