- play_cmdline_parser_ext(argc, argv, &conf, ¶ms);
- loglevel = get_loglevel_by_name(conf.loglevel_arg);
- version_handle_flag("play", conf.version_given);
- if (conf.help_given || conf.detailed_help_given)
- print_help_and_die();
- if (conf.config_file_given)
- config_file = para_strdup(conf.config_file_arg);
- else {
- char *home = para_homedir();
- config_file = make_message("%s/.paraslash/play.conf", home);
- free(home);
- }
- ret = file_exists(config_file);
- if (conf.config_file_given && !ret) {
- PARA_EMERG_LOG("can not read config file %s\n", config_file);
- goto err;
+ ret = lls(lls_parse(argc, argv, CMD_PTR, &play_lpr, &errctx));
+ if (ret < 0) {
+ if (errctx)
+ PARA_EMERG_LOG("%s\n", errctx);
+ free(errctx);
+ PARA_EMERG_LOG("failed to parse command line options: %s\n",
+ para_strerror(-ret));
+ exit(EXIT_FAILURE);