-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] Support xargs -I <replace_str> #77
Comments
It would be good to split these out into two issues. Looping probably won't be implemented because if you are doing loops then you probably shouldn't be writing that in a task and instead use JavaScript for that ( |
Thanks, I've made the split. Feel free to close the loop issue if it doesn't make sense--I opened it because I thought it was likely to come up again and it'd be nice to centralize that discussion. |
@niedzielski thanks! I'll keep it open for now as a "suggestion" to see what other use cases come up. |
Excuse me for interrupting. I posted denoland/deno#25248 in the Discussions of the » How do I insert the |
The
xargs
command is super useful but is too constrained to use for invocations that depend on positional parameters. This feature request asks for the traditional -I/-i/--replace flags to be added.Eg:
Unfortunately,
-I
always constrains the maximum number of lines processed at a time to 1 and approximates the following loop:Although both looping and
xargs -I
provide similar functionality, I think they serve different uses. Simple loops are wanted for simple lists and xargs is wanted for pipes.Use case
In the absence of this support, task users are at the mercy of the subcommands they call. For example, here's how you would have to do copy with the current version of xargs:
However, many tools don't support non-positional arguments like the target parameter so this isn't an option. Even Deno's own cp command doesn't support
-t
so this also fails:References
The text was updated successfully, but these errors were encountered: