Skip to content

xargs: add support for -E option#593

Merged
cakebaker merged 3 commits into
uutils:mainfrom
brian-pane:xargs
Nov 19, 2025
Merged

xargs: add support for -E option#593
cakebaker merged 3 commits into
uutils:mainfrom
brian-pane:xargs

Conversation

@brian-pane

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Nov 11, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.69%. Comparing base (0f7bf4d) to head (2e74005).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #593      +/-   ##
==========================================
+ Coverage   88.88%   91.69%   +2.81%     
==========================================
  Files          31       31              
  Lines        6297     6179     -118     
  Branches      324      327       +3     
==========================================
+ Hits         5597     5666      +69     
+ Misses        578      392     -186     
+ Partials      122      121       -1     

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

@brian-pane

Copy link
Copy Markdown
Contributor Author

I'll add more test coverage and post an update.

Comment thread src/xargs/mod.rs Outdated
Comment on lines +659 to +671
match self.reader.next() {
Err(e) => Err(e),
Ok(arg) => match arg {
None => Ok(None),
Some(arg) => {
if arg.arg == self.eof_delimiter {
Ok(None)
} else {
Ok(Some(arg))
}
}
},
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can simplify the code a bit by using map. Something like:

Suggested change
match self.reader.next() {
Err(e) => Err(e),
Ok(arg) => match arg {
None => Ok(None),
Some(arg) => {
if arg.arg == self.eof_delimiter {
Ok(None)
} else {
Ok(Some(arg))
}
}
},
}
self.reader.next().map(|opt| {
opt.and_then(|arg| {
if arg.arg == self.eof_delimiter {
None
} else {
Some(arg)
}
})
})

@cakebaker cakebaker linked an issue Nov 19, 2025 that may be closed by this pull request
@cakebaker cakebaker merged commit 573b9b7 into uutils:main Nov 19, 2025
20 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks for your PR!

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.

xargs: support -E/--eof flag

2 participants