forked from uutils/findutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an initial implementation of xargs
This includes much of the core xargs functionality, with the following notable exceptions: - Parallel execution (`-P`): This option currently just does nothing, that way anything that passes -P can at least run without a notable behavior shift (other than simply being slower). - Replacement strings (`-I`): This can easily be worked around via an intermediate shell invocation (e.g. `xargs -L1 sh -c 'do-things-with $@' --`). - EOF strings (`-E`): I've honestly never seen this actually used, though it would not be particularly difficult to implement given the current architecture. Closes uutils#37 Signed-off-by: Ryan Gonzalez <[email protected]>
- Loading branch information
Showing
7 changed files
with
1,616 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ extern crate walkdir; | |
extern crate tempfile; | ||
|
||
pub mod find; | ||
pub mod xargs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2021 Collabora, Ltd. | ||
// | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
fn main() { | ||
let args = std::env::args().collect::<Vec<String>>(); | ||
std::process::exit(findutils::xargs::xargs_main( | ||
&args.iter().map(|s| s.as_ref()).collect::<Vec<&str>>(), | ||
)) | ||
} |
Oops, something went wrong.