Skip to content

cmp: match GNU usage errors messages - #392

Open
qezem wants to merge 3 commits into
uutils:mainfrom
qezem:fix/cmp-usage-error
Open

qezem wants to merge 3 commits into
uutils:mainfrom
qezem:fix/cmp-usage-error

Conversation

@qezem

@qezem qezem commented Nov 14, 2026

Copy link
Copy Markdown

Fixes #347
Fixes #177

This PR updates command-line usage error messages in cmp to match GNU cmp behavior:

  • Adds the executable name prefix (<executable>: ) to all usage error messages.
  • Appends the <executable>: Try '<executable> --help' for more information. hint line.
  • Reports specific operand and option errors (missing operand after '...', extra operand '...', unrecognized option '...', and option requires an argument -- '...') instead of a generic Usage: line.
  • Updates existing unit tests and adds integration tests verifying the GNU-compatible stderr output.

@codspeed

codspeed Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 30.12%

1 warning

⚠️ 24 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 1 regressed benchmark
✅ 25 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ cmp_parser 10.6 µs 15.1 µs -30.12%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing qezem:fix/cmp-usage-error (6c210fd) with main (a003a80)

Open in CodSpeed

@qezem

qezem commented Nov 14, 2026

Copy link
Copy Markdown
Author

i dont know how to optimize it...

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.

cmp - usage errors lack GNU's wording, cmp: prefix and "Try --help" line cmp argument parser rewrite

1 participant