- }
- if (ret) {
- struct client_cmdline_parser_params params = {
- .override = 0,
- .initialize = 0,
- .check_required = 0,
- .check_ambiguity = 0,
- .print_errors = 0
- };
- ret = -E_BAD_CONFIG;
- if (client_cmdline_parser_config_file(ct->config_file,
- &ct->conf, ¶ms))
+ ll = CLIENT_OPT_UINT32_VAL(LOGLEVEL, lpr);
+ version_handle_flag("client", CLIENT_OPT_GIVEN(VERSION, lpr));
+ handle_help_flag(lpr);
+
+ if (CLIENT_OPT_GIVEN(CONFIG_FILE, lpr))
+ cf = para_strdup(CLIENT_OPT_STRING_VAL(CONFIG_FILE, lpr));
+ else
+ cf = make_message("%s/.paraslash/client.conf", home);
+ ret = mmap_full_file(cf, O_RDONLY, &map, &sz, NULL);
+ if (ret < 0) {
+ if (ret != -E_EMPTY && ret != -ERRNO_TO_PARA_ERROR(ENOENT))
+ goto out;
+ if (ret == -ERRNO_TO_PARA_ERROR(ENOENT) &&
+ CLIENT_OPT_GIVEN(CONFIG_FILE, lpr))