4 releases (2 breaking)
0.3.1 | Sep 4, 2022 |
---|---|
0.3.0 | May 25, 2022 |
0.2.0 | May 15, 2022 |
0.1.0 | Jan 23, 2022 |
#410 in Command-line interface
9,764 downloads per month
Used in 3 crates
16KB
269 lines
argmax
argmax
is a library that allows Rust applications to avoid Argument list too long errors (E2BIG
) by providing a std::process::Command
wrapper with a
fn try_arg<S: AsRef<OsStr>>(&mut self, arg: S) -> io::Result<&mut Self>
function that returns a proper Err
or if arg
would overflow the maximum size.
Resources
This library draws inspiration from the following sources. The implementation is based on
the corresponding functionality in bfs
[1].
- https://github.com/tavianator/bfs/blob/9b50adaaaa4fedc8bda6fcf32595ecf7a682fa8b/exec.c#L72
- http://mywiki.wooledge.org/BashFAQ/095
- https://www.in-ulm.de/~mascheck/various/argmax/
- https://stackoverflow.com/questions/46897008/why-am-i-getting-e2big-from-exec-when-im-accounting-for-the-arguments-and-the
- https://github.com/rust-lang/rust/issues/40384
-
xargs --show-limits
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Dependencies
~1.5MB
~35K SLoC