| Crates.io | larpa |
| lib.rs | larpa |
| version | 0.1.1 |
| created_at | 2025-11-19 14:56:51.595159+00 |
| updated_at | 2025-11-20 11:06:01.83633+00 |
| description | Lousy ARgument PArser |
| homepage | |
| repository | https://github.com/SludgePhD/Larpa |
| max_upload_size | |
| id | 1940209 |
| size | 175,368 |
A simple #[derive]-based command line argument parsing library.
--help/--version output.#[derive]-based design isn't a good fit. Use something like lexopt instead.#![no_std] usage, or operating systems that are significantly
different from Unix or Windows.use larpa::Command;
use larpa::types::Verbosity;
use std::path::PathBuf;
#[derive(Command)]
struct Shredder {
/// Output more information.
#[larpa(name = ["-v", "--verbose"], flag)]
verbosity: Verbosity,
/// Output less information.
#[larpa(name = ["-q", "--quiet"], flag, inverse_of = "verbosity")]
quiet: (),
/// The configuration file to use.
#[larpa(name = "--config")]
config: Option<PathBuf>,
/// The speed to run the shredder at (in RPM).
#[larpa(name = ["-s", "--speed"], default = "8000.0")]
speed: f64,
/// Path to the file to shred (or `-` to shred data from stdin).
file: PathBuf,
}
This library targets the latest Rust version.
Older Rust versions are supported by equally older versions of this crate. For example, to use a version of Rust that was succeeded 6 months ago, you'd also use an at least 6 month old version of this library.
Compatibility with older Rust versions may be provided on a best-effort basis.
The minimum supported Rust version is specified as rust-version in Cargo.toml, and tested
against in CI, so Cargo's resolver should find a version for you that works.