https://github.com/alorel/argley-rs
Turn a struct into arguments for a Command.
https://github.com/alorel/argley-rs
Last synced: 2 days ago
JSON representation
Turn a struct into arguments for a Command.
- Host: GitHub
- URL: https://github.com/alorel/argley-rs
- Owner: Alorel
- License: apache-2.0
- Created: 2023-06-17T17:15:48.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T21:27:04.000Z (6 months ago)
- Last Synced: 2025-03-28T03:03:41.174Z (29 days ago)
- Language: Rust
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/Alorel/argley-rs/actions/workflows/ci.yml?query=branch%3Amaster)
[](https://crates.io/crates/argley)
[](https://docs.rs/argley)
[](https://libraries.io/cargo/argley)Turn a struct into arguments for a [Command](https://doc.rust-lang.org/stable/std/process/struct.Command.html).
```rust
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](https://crates.io/crates/async-std) and [tokio](https://crates.io/crates/tokio) can be enabled
via their respective features.See crate-level docs for detailed configuration options.