- audioc_cmdline_parser(argc, argv, &conf);
- loglevel = get_loglevel_by_name(conf.loglevel_arg);
- version_handle_flag("audioc", conf.version_given);
- if (conf.help_given || conf.detailed_help_given)
- print_help_and_die();
- cf = configfile_exists();
- if (cf) {
- struct audioc_cmdline_parser_params params = {
- .override = 0,
- .initialize = 0,
- .check_required = 0,
- .check_ambiguity = 0,
- .print_errors = 1,
-
- };
- audioc_cmdline_parser_config_file(cf, &conf, ¶ms);
- free(cf);
- loglevel = get_loglevel_by_name(conf.loglevel_arg);
- }
- if (conf.socket_given)
- socket_name = para_strdup(conf.socket_arg);
+ ret = lls(lls_parse(argc, argv, CMD_PTR, &lpr, &errctx));
+ if (ret < 0)
+ goto fail;
+ version_handle_flag("audioc", OPT_GIVEN(VERSION));
+ handle_help_flag();
+ ret = lsu_merge_config_file_options(NULL, "audioc.conf",
+ &lpr, CMD_PTR, audioc_suite, 0 /* default flags */);
+ if (ret < 0)
+ goto fail;
+ loglevel = OPT_UINT32_VAL(LOGLEVEL);
+ if (OPT_GIVEN(COMPLETE))
+ print_completions();
+ if (OPT_GIVEN(SOCKET))
+ socket_name = para_strdup(OPT_STRING_VAL(SOCKET));