Skip to content

fix: match GNU error format for unrecognized options#180

Open
Ryujiyasu wants to merge 2 commits intouutils:mainfrom
Ryujiyasu:fix/unrecognized-option-format
Open

fix: match GNU error format for unrecognized options#180
Ryujiyasu wants to merge 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'

Ryujiyasu and others added 2 commits February 28, 2026 22:15
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>
Copy link

@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.

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.

2 participants