static struct argp_option options[] = {
{"verbose", 'v', 0, 0,
"Increase verbosity (can be specified more than once for debugging)"},
- {"quiet", 'q', 0, 0, "Only show errors"},
{"split", 's', "STRING", 0, "Split chunks at beginning of STRING"},
{"dict", 'D', "FILE", 0,
"Set zstd compression dictionary to FILE"},
if(arguments->log_level < ZCK_LOG_DDEBUG)
arguments->log_level = ZCK_LOG_DDEBUG;
break;
- case 'q':
- arguments->log_level = ZCK_LOG_ERROR;
- break;
case 's':
arguments->split_string = arg;
break;
struct arguments arguments = {0};
/* Defaults */
- arguments.log_level = ZCK_LOG_WARNING;
+ arguments.log_level = ZCK_LOG_ERROR;
argp_parse (&argp, argc, argv, 0, 0, &arguments);
free(out_name);
exit(1);
}
- free(out_name);
zckCtx *zck = zck_create();
if(zck == NULL) {
exit(1);
}
if(!zck_init_write(zck, dst_fd)) {
- printf("Unable to write to %s\n", out_name);
+ printf("Unable to write to %s: %s", out_name, zck_get_error(zck));
exit(1);
}
+ free(out_name);
/*if(!zck_set_ioption(zck, ZCK_COMP_TYPE, ZCK_COMP_NONE)) {
perror("Unable to set compression type\n");
static struct argp_option options[] = {
{"verbose", 'v', 0, 0,
"Increase verbosity (can be specified more than once for debugging)"},
- {"quiet", 'q', 0, 0, "Only show errors"},
{"version", 'V', 0, 0, "Show program version"},
{ 0 }
};
if(arguments->log_level < ZCK_LOG_DDEBUG)
arguments->log_level = ZCK_LOG_DDEBUG;
break;
- case 'q':
- arguments->log_level = ZCK_LOG_ERROR;
- break;
case 'V':
version();
break;
struct arguments arguments = {0};
/* Defaults */
- arguments.log_level = ZCK_LOG_WARNING;
+ arguments.log_level = ZCK_LOG_ERROR;
argp_parse (&argp, argc, argv, 0, 0, &arguments);
exit(1);
}
if(!zck_init_read(zck_src, src_fd)) {
- printf("Unable to read header from %s\n", arguments.args[0]);
+ printf("Error reading %s: %s", arguments.args[0],
+ zck_get_error(zck_src));
exit(1);
}
close(src_fd);
exit(1);
}
if(!zck_init_read(zck_tgt, tgt_fd)) {
- printf("Unable to open %s\n", arguments.args[1]);
+ printf("Error reading %s: %s", arguments.args[1],
+ zck_get_error(zck_tgt));
exit(1);
}
close(tgt_fd);