- static char *cf; /* config file */
- struct stat statbuf;
-
- if (filter_cmdline_parser(argc, argv, &conf))
- return -E_FILTER_SYNTAX;
- HANDLE_VERSION_FLAG("filter", conf);
- if (conf.help_given || conf.detailed_help_given)
- print_help_and_die();
- loglevel = get_loglevel_by_name(conf.loglevel_arg);
- 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
- };
- if (filter_cmdline_parser_config_file(cf, &conf, ¶ms))
- return -E_FILTER_SYNTAX;
+ 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);