| Crates.io | argley |
| lib.rs | argley |
| version | 1.3.0 |
| created_at | 2023-06-17 19:21:10.163206+00 |
| updated_at | 2023-07-08 19:49:09.548248+00 |
| description | Turn a struct into arguments for a `Command` |
| homepage | |
| repository | https://github.com/Alorel/argley-rs |
| max_upload_size | |
| id | 893082 |
| size | 27,499 |
Turn a struct into arguments for a Command.
use argley::prelude::*;
#[derive(Args)]
struct Args<'a> {
compress: bool,
#[arg(rename = "dir")]
output_dir: &'a Path,
#[arg(variadic)]
input_files: Vec<&'a Path>,
}
let args = Args {
compress: true,
output_dir: Path::new("./output"),
input_files: vec![Path::new("./foo.txt"), Path::new("./bar.txt")],
};
let output = Command::new("some-application")
.add_arg_set(&args)
.output()
.unwrap();
Support for async-std and tokio can be enabled via their respective features.
See crate-level docs for detailed configuration options.