Skip to content

fix: match GNU error format for unrecognized options#180

Merged
sylvestre merged 2 commits intouutils:mainfrom
Ryujiyasu:fix/unrecognized-option-format
Mar 10, 2026
Merged

fix: match GNU error format for unrecognized options#180
sylvestre merged 2 commits intouutils:mainfrom
Ryujiyasu:fix/unrecognized-option-format

Conversation

@Ryujiyasu
Copy link
Contributor

Summary

Follow-up to #178 / #179. Adjusts the unrecognized option error message to match the actual GNU diff/cmp output format:

  • Remove colon after unrecognized option
  • Use single quotes instead of double quotes ('--foobar' instead of "--foobar")
  • Use contains instead of starts_with in integration test to handle the command prefix (e.g. cmp: unrecognized option ...)

Before: unrecognized option: "--foobar"
After: unrecognized option '--foobar'

As pointed out by @GunterSchmidt in #178 (comment).

Test plan

  • cargo test — all 125 unit tests and 21 integration tests pass
  • Verified diffutils diff --foobar outputs unrecognized option '--foobar'
  • Verified diffutils cmp --foobar outputs unrecognized option '--foobar'

Copy link
Contributor

@GunterSchmidt GunterSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks.

Ryujiyasu and others added 2 commits March 7, 2026 18:35
Use single quotes and remove colon to match GNU diff/cmp output:
`unrecognized option '--foobar'` instead of `unrecognized option: "--foobar"`

Also use `contains` instead of `starts_with` in the integration test
to handle the command prefix (e.g. `cmp: unrecognized option ...`).

Follow-up to uutils#178 / uutils#179.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sylvestre sylvestre force-pushed the fix/unrecognized-option-format branch from e6a28ea to 5398c6d Compare March 7, 2026 17:35
@codspeed-hq
Copy link
Contributor

codspeed-hq bot commented Mar 7, 2026

Merging this PR will not alter performance

✅ 26 untouched benchmarks


Comparing Ryujiyasu:fix/unrecognized-option-format (5398c6d) with main (59e130a)

Open in CodSpeed

@oSoMoN
Copy link
Collaborator

oSoMoN commented Mar 8, 2026

The change looks harmless. I haven't been paying much attention to uutils/diffutils lately, and I'm having a hard time parsing the following things:

  • The two commits in this PR are co-authored by Claude Opus 4.6, but their contents are really very trivial. Is that a reasonable use of LLMs? Has the use of coding agents been discussed in the context of uutils, do we have some sort of policy/guidelines around their usage in the projects?
  • The two commits are authored by @Ryujiyasu, but committed by @sylvestre, in Ryuji Yasukochi's branch. What's up with this? EDIT: is this because Sylvestre rebased and force-pushed?

@sylvestre sylvestre merged commit 9dcca24 into uutils:main Mar 10, 2026
28 checks passed
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (59e130a) to head (5398c6d).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #180   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants