From bc11facb648fd6fa60afc0ebe8bdaec1980ae079 Mon Sep 17 00:00:00 2001 From: RyujiYasukochi Date: Sat, 28 Feb 2026 21:11:41 +0900 Subject: [PATCH 1/2] fix: rename "Unknown option" to "unrecognized option" for diff and cmp Fixes #178 Co-Authored-By: Claude Opus 4.6 --- src/cmp.rs | 2 +- src/params.rs | 2 +- tests/integration.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmp.rs b/src/cmp.rs index 3e1eda6..1db866b 100644 --- a/src/cmp.rs +++ b/src/cmp.rs @@ -217,7 +217,7 @@ pub fn parse_params>(mut opts: Peekable) -> Resu std::process::exit(0); } if param_str.starts_with('-') { - return Err(format!("Unknown option: {param:?}")); + return Err(format!("unrecognized option: {param:?}")); } if from.is_none() { from = Some(param); diff --git a/src/params.rs b/src/params.rs index 7d7d4f8..921a397 100644 --- a/src/params.rs +++ b/src/params.rs @@ -195,7 +195,7 @@ pub fn parse_params>(mut opts: Peekable) -> Resu Err(error) => return Err(error), } if param.to_string_lossy().starts_with('-') { - return Err(format!("Unknown option: {param:?}")); + return Err(format!("unrecognized option: {param:?}")); } if from.is_none() { from = Some(param); diff --git a/tests/integration.rs b/tests/integration.rs index b37d7e6..b29c98d 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -39,7 +39,7 @@ mod common { cmd.assert() .code(predicate::eq(2)) .failure() - .stderr(predicate::str::starts_with("Unknown option: \"--foobar\"")); + .stderr(predicate::str::starts_with("unrecognized option: \"--foobar\"")); } Ok(()) } From 859784352040e1195ec2ac449d3833355b5da7ff Mon Sep 17 00:00:00 2001 From: RyujiYasukochi Date: Sat, 28 Feb 2026 21:16:00 +0900 Subject: [PATCH 2/2] style: apply cargo fmt formatting Co-Authored-By: Claude Opus 4.6 --- tests/integration.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index b29c98d..c9db571 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -39,7 +39,9 @@ mod common { cmd.assert() .code(predicate::eq(2)) .failure() - .stderr(predicate::str::starts_with("unrecognized option: \"--foobar\"")); + .stderr(predicate::str::starts_with( + "unrecognized option: \"--foobar\"", + )); } Ok(()) }