pareg
Helpful utilities for parsing command line arguments.
The aim of this crate is not to automate parsing of command line arguments because there are many ways to construct a CLI for your application and universal parser is not would be as hard to use as just writing it yourself. Instead this crate provides useful types and parsing funcitonality to make the process of writing your own code to parse command line arguments as simple as possible: It provides special iterator for the arguments that can parse them in various ways and plenty of useful parsing functions and macros. Everything is made to minimize the repetetive part of the code for parsing the arguments and with performance in mind. If you wan't to see examples see docs.
Main constructs:
ArgIterator: iterator over arguments that can also parse them.FromArg: trait simmilar toFromStr. It is used by all the parsing functionality in this crate. There is also simple derive macro for enums.- It is implemented for all types in standard library that implement
FromStrand there is simple trait to just markFromStrimplementation as alsoFromArg:FromArgStr.
- It is implemented for all types in standard library that implement
- macros
starts_anyandhas_any_key: useful for checking argument types.
How to use it
Documentation and examples are available at the docs.
How to get it
It is available on crates.io:
With cargo
cargo add pareg
In Cargo.toml
[]
= "0.1.0"
Links
- Author: BonnyAD9
- GitHub repository: BonnyAD/pareg
- Package: crates.io
- Documentation: docs.rs
- My Website: bonnyad9.github.io