From a2e986874bde9251f2a2c045cd6d8cb9cbbc605f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Mar 2026 12:26:05 +0000 Subject: [PATCH] Emit stats output in NSV format Use nsv::encode to produce a 2-column NSV table (key, value) instead of ad-hoc "key: value" lines, making the output machine-readable and self-consistent with the tool's own format. https://claude.ai/code/session_01UNoSXqMRouTeNhG1T4PYW3 --- src/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8628110..78c2c43 100644 --- a/src/main.rs +++ b/src/main.rs @@ -162,7 +162,7 @@ fn process_line_endings(data: &[u8], start: usize, quiet: bool) -> Result) { .max() .unwrap_or(0); - println!("rows: {}", num_rows); - println!("cells: {}", cells); - println!("min_arity: {}", min_arity); - println!("max_arity: {}", max_arity); - println!("is_table: {}", is_table); - println!("max_cell_bytes: {}", max_cell_bytes); + let data = vec![ + vec!["rows".to_string(), num_rows.to_string()], + vec!["cells".to_string(), cells.to_string()], + vec!["min_arity".to_string(), min_arity.to_string()], + vec!["max_arity".to_string(), max_arity.to_string()], + vec!["is_table".to_string(), is_table.to_string()], + vec!["max_cell_bytes".to_string(), max_cell_bytes.to_string()], + ]; + print!("{}", nsv::encode(&data)); } /// Validate NSV data. Returns the process exit code.