9 releases
0.2.1 | Jul 25, 2024 |
---|---|
0.2.0 | Apr 12, 2024 |
0.1.6 | Sep 8, 2023 |
0.1.5 | Sep 28, 2022 |
0.1.3 | Dec 16, 2021 |
#303 in Command-line interface
104,607 downloads per month
Used in 20 crates
(13 directly)
16KB
149 lines
argfile
Load additional CLI args from file
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.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
argfile
Load additional CLI args from file
Prior art:
This is meant to work with any CLI parser, like clap, by pre-processing the arguments, like wild.
Examples
argfile::expand_args(
argfile::parse_fromfile,
argfile::PREFIX,
).unwrap();
To integrate this with wild and clap
let args = wild::args_os();
let args = argfile::expand_args_from(
args,
argfile::parse_fromfile,
argfile::PREFIX,
).unwrap();
let matches = clap::Command::new("your_app")
.get_matches_from(args);
Dependencies
~310–460KB