- if (audioc_cmdline_parser(argc, argv, &conf))
- goto out;
- HANDLE_VERSION_FLAG("audioc", conf);
- cf = configfile_exists();
- if (cf) {
- struct audioc_cmdline_parser_params params = {
- .override = 0,
- .initialize = 0,
- .check_required = 0,
- .check_ambiguity = 0
- };
- ret = audioc_cmdline_parser_config_file(cf, &conf, ¶ms);
- free(cf);
- if (ret) {
- fprintf(stderr, "parse error in config file\n");
- exit(EXIT_FAILURE);
- }
- }
- 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));