From bf5f4a5d61fc06d27dbbe7d08ac275e6c9649cc0 Mon Sep 17 00:00:00 2001 From: liquidaty Date: Mon, 16 Dec 2024 17:43:09 -0800 Subject: [PATCH] desc: with -H, stop processing after reading header (#344) --- app/desc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/desc.c b/app/desc.c index a0f4cfbb..d607f037 100644 --- a/app/desc.c +++ b/app/desc.c @@ -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); @@ -423,7 +425,7 @@ const char *zsv_desc_usage_msg[] = { "", "Options:", " -b,--with-bom : output with BOM", - " -C : maximum number of columns (default: 1024)", + " -C : 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)",