dd: quote invalid status level - #13923
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates dd’s error output for unrecognized status= values to quote the user-provided level (matching GNU dd’s style) and adds a regression test to lock the behavior in.
Changes:
- Updated the
dd-error-status-not-recognizedmessage in the en-US Fluent locale to include quotes around the provided status level. - Added an integration test ensuring
dd status=invalidfails with the newly formatted, quoted error message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/by-util/test_dd.rs | Adds a regression test asserting the quoted error message for an invalid status= value. |
| src/uu/dd/locales/en-US.ftl | Updates the en-US localized parse error string for unrecognized status= levels to include quoting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| dd-error-multiplier-overflow = Multiplier string would overflow on current system -> { $input } | ||
| dd-error-block-without-cbs = conv=block or conv=unblock specified without cbs=N | ||
| dd-error-status-not-recognized = status=LEVEL not recognized -> { $level } | ||
| dd-error-status-not-recognized = invalid status level: ‘{ $level }’ |
There was a problem hiding this comment.
I don't know what's the French equivalent of that error message.
| fn test_invalid_status_level() { | ||
| new_ucmd!() | ||
| .args(&["status=invalid"]) | ||
| .fails() | ||
| .stderr_contains("dd: invalid status level: ‘invalid’"); | ||
| } |
There was a problem hiding this comment.
Do I still have to include this or not?
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | du_summarize_balanced_tree[(5, 4, 10)] |
16.2 ms | 16.7 ms | -3.11% |
| ⚡ | Simulation | complex_relative_date |
330.6 µs | 318.7 µs | +3.72% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing Xylphy:fix/dd-quote-invalid-status-level (8a07d67) with main (4ca7ded)2
Footnotes
-
50 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(668ea71) during the generation of this report, so 4ca7ded was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Fixes #13868
Summary
Updates the
dderror message for an unrecognizedstatus=value so that the user-provided value is quoted.Before
After
GNU (Reference)