Larpa: The Lousy Argument Parser.
A simple #[derive]-based command line argument parsing library.
Goals
- Stay more lightweight than Clap, while providing many of its bells and whistles in an easier-to-digest package with a simpler API.
- Provide built-in generation of
--help/--versionoutput. - Build a well-designed, stable, intuitive API surface that I can proudly publish as 1.0.0.
Non-Goals
- Handle all possible command-line interfaces.
- Larpa aims to handle all reasonable command-line interfaces that roughly adhere to the GNU CLI argument conventions, but not more than that.
- In particular, order-dependent named arguments or argument groups will probably never be
supported, as the
#[derive]-based design isn't a good fit. Use something like lexopt instead. - Dynamically constructing and modifying the accepted syntax of the command-line interface will also likely never be supported. Use Clap instead.
- Handle weird/niche use cases like
#![no_std]usage, or operating systems that are significantly different from Unix or Windows.
Example
use Command;
use Verbosity;
use PathBuf;
Rust Version Support
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.