From 9afa13f78a48e87ef049c58c3865371920d015e1 Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Sat, 4 Apr 2026 09:31:49 -0700 Subject: [PATCH] improve error formatting - Added missing comma in error message for set-cell command. - Reformatted error messages for consistency. - Minor formatting changes to improve readability. Co-Authored-By: fiddlerwoaroof/git-smart-commit (gpt-oss:20b) --- src/command/parse.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/command/parse.rs b/src/command/parse.rs index f8dc113..5cf5bb3 100644 --- a/src/command/parse.rs +++ b/src/command/parse.rs @@ -122,7 +122,7 @@ fn parse_command(segment: &str) -> Result { "set-cell" => { if args.len() < 2 { return Err( - "set-cell requires a value and at least one Cat/Item coordinate".to_string() + "set-cell requires a value and at least one Cat/Item coordinate".to_string(), ); } let value = parse_cell_value(&args[0])?; @@ -254,7 +254,10 @@ fn parse_command(segment: &str) -> Result { fn require_args(word: &str, args: &[String], n: usize) -> Result<(), String> { if args.len() < n { - Err(format!("{word} requires {n} argument(s), got {}", args.len())) + Err(format!( + "{word} requires {n} argument(s), got {}", + args.len() + )) } else { Ok(()) } @@ -287,7 +290,9 @@ fn parse_axis(s: &str) -> Result { "column" | "col" => Ok(Axis::Column), "page" => Ok(Axis::Page), "none" => Ok(Axis::None), - _ => Err(format!("Unknown axis: {s} (expected row, column, page, none)")), + _ => Err(format!( + "Unknown axis: {s} (expected row, column, page, none)" + )), } }