Conversation
| - Print the piped data: | ||
|
|
||
| - Run multiple chained commands on the input data: | ||
| `{{arguments_source}} | xargs` |
There was a problem hiding this comment.
What's the use of this example? 🤔
There was a problem hiding this comment.
To display what data xargs is receiving. It's also the simplest form of the command.
There was a problem hiding this comment.
Yeah, it is technically the simplest, but it also does nothing. I mean, if you don't pipe to xargs, you'd get exactly the same output in the stdout, no? Or am I missing something?
There was a problem hiding this comment.
Not exactly the same. All data is concatenated, separated by spaces even if the original data contains newlines
There was a problem hiding this comment.
Still seems like something that other commands (e.g. sed, tr) would be more appropriate for than xargs IMHO.
There was a problem hiding this comment.
I adjusted the description a bit so that it can be considered as a dry-run.
pages/common/xargs.md
Outdated
|
|
||
| - Define maximum amount of parallel processes (default is 1). If the number is 0, xargs will run as many processes as possible at a time: | ||
|
|
||
| `{{arguments_source}} | xargs {{[-P|--max-procs]}} {{number}} {{command}}` |
There was a problem hiding this comment.
Oh hey, good question here: does --max-procs even do anything if --max-args isn't set?
There was a problem hiding this comment.
I wouldn't focus on the "maximum" aspect here. By default xargs only spawns one process, and this bumps that number up, so the original description seems clearer. I agree with your choice of using parenthesis for the default, though. So: "Parallel runs of up to max-procs processes at a time (default is 1)."
As for --max-args, it seems like we might want to add {{[-n|--max-args]}} 1 here, yeah. But I'm not a xargs expert, so maybe others can help clarify if that makes sense.
There was a problem hiding this comment.
Alright. I only assumed so since you've been prevalent in the history of this file.
Some inspiration from distrotube https://www.youtube.com/watch?v=tUkQcvytVtw