Skip to content

xargs: add --show-limits diagnostics#686

Open
kevinburke wants to merge 1 commit into
uutils:mainfrom
kevinburke:xargs-show-limits
Open

xargs: add --show-limits diagnostics#686
kevinburke wants to merge 1 commit into
uutils:mainfrom
kevinburke:xargs-show-limits

Conversation

@kevinburke
Copy link
Copy Markdown
Contributor

Among other things, Debian maintainers use the output of xargs --show-limits to set --max-chars appropriately for subsequent commands.

Accept GNU-compatible --show-limits and print command-line size diagnostics before reading input or building a command. The output includes the Maximum length line parsed by Debian maintainer scripts.

The regression test links to Debian python3.13's
libPVER-minimal.prerm.in, where 3.13.5-2+deb13u2 parses xargs --show-limits, and to GNU findutils 4.10.0's xargs/xargs.c, where the diagnostic text is emitted.

Reuse the existing system command-size calculation for both the default limiter and the diagnostic output, and add an integration test for the parsed limit.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.86%. Comparing base (b07b27d) to head (75aa0a9).

Files with missing lines Patch % Lines
src/xargs/mod.rs 95.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   91.85%   91.86%   +0.01%     
==========================================
  Files          31       31              
  Lines        6420     6454      +34     
  Branches      338      340       +2     
==========================================
+ Hits         5897     5929      +32     
- Misses        397      398       +1     
- Partials      126      127       +1     

☔ View full report in Codecov by Harness.
📢 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.

Among other things, Debian maintainers use the output of xargs
--show-limits to set --max-chars appropriately for subsequent
commands.

Accept GNU-compatible --show-limits and print command-line size
diagnostics before reading input or building a command. The output includes
the Maximum length line parsed by Debian maintainer scripts.

The regression test links to Debian python3.13's
libPVER-minimal.prerm.in, where 3.13.5-2+deb13u2 parses xargs
--show-limits, and to GNU findutils 4.10.0's xargs/xargs.c, where the
diagnostic text is emitted.

Reuse the existing system command-size calculation for both the
default limiter and the diagnostic output, and add an integration test
for the parsed limit.
@sylvestre sylvestre force-pushed the xargs-show-limits branch from 0ef2c9c to 75aa0a9 Compare June 4, 2026 20:08
@sylvestre
Copy link
Copy Markdown
Contributor

we have a difference here:


  echo "=== GNU ==="; printf 'a\nb\n' | /usr/bin/xargs --show-limits echo RAN 2>/dev/null
  echo "=== PR ===";  printf 'a\nb\n' | ./target/release/xargs --show-limits echo RAN 2>/dev/null

Copy link
Copy Markdown
Contributor

@sylvestre sylvestre left a comment

Choose a reason for hiding this comment

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

see the last comment

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