Skip to content

Commit

Permalink
desc: with -H, stop processing after reading header (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidaty authored Dec 17, 2024
1 parent d10cdaa commit bf5f4a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,10 @@ static void zsv_desc_row(void *ctx) {
col->unique_values_ci.max_count = data->max_enum;
}

if (data->header_only)
if (data->header_only) {
data->done = 1;
zsv_abort(data->parser);
}
} else {
if (data->row_count % 50000 == 0 && data->opts->verbose)
fprintf(stderr, "%zu rows read\n", data->row_count);
Expand All @@ -423,7 +425,7 @@ const char *zsv_desc_usage_msg[] = {
"",
"Options:",
" -b,--with-bom : output with BOM",
" -C <max_num_of_columns> : maximum number of columns (default: 1024)",
" -C <max_num_of_columns> : maximum number of columns (default: " ZSV_DESC_MAX_COLS_DEFAULT_S ")",
" -H : output header names only",
" -q,--quick : minimize example counts",
" -a,--all : calculate all metadata (for now, this only adds uniqueness info)",
Expand Down

0 comments on commit bf5f4a5

Please sign in to comment.