jaarg argument parser library
Dependency-free, const (mostly), no magic macros, no_std & no alloc (though nicer with those).
Some say it can parse your arguments.
Obligatory fancy banners
Example usage
// Variables for arguments to fill
let mut file = new;
let mut out: = None;
let mut number = 0;
// Set up arguments table
const OPTIONS: = new.with_description;
// Parse command-line arguments from `std::env::args()`
match OPTIONS.parse_easy
// Print the result variables
println!;
Changelog
v0.2.2:
- Fixed coerced
ArgumentErrornot being rewritten for positional arguments. - Moved top level includes to
pub use. - Hopefully work around licence & read me texts not being included in crate.
v0.2.1:
- Fixed licence field in
Cargo.toml.
v0.2.0:
- Change licence from
MITtoMIT OR Apache-2.0. - Moved
Opts::parse_mapinto newly introducedalloccrate, making it accessible forno_stdusers. - More generic & flexible help API: removed forced newline, moved error writer to
StandardErrorUsageWriter, generalised "Usage" line in standard full writer, enough public constructs to roll a custom help writer. - Added the ability to exclude options from short usage, full help, or both.
- More tests for validating internal behaviour & enabled CI on GitHub.
- Added new
no_stdexamples.
v0.1.1:
- Fixed incorrect error message format for coerced parsing errors.
- Cleaned up docstring formatting.
- Added basic example.
v0.1.0:
- Initial release.
Roadmap
Near future:
- More control over parsing behaviour (getopt style, no special casing shorts for Windows style flags, etc.)
- More practical examples.
Long term:
- Strategy for handling exclusive argument groups.
- Make use of const traits when they land to improve table setup.
Projects using jaarg (very cool)
Licensing
jaarg is dual-licensed under either the MIT or Apache 2.0 licences. Pick whichever works best for your project.