Define a simple command-line parser through a declarative macro.
This is not intended to be a complete command-line parser library. Instead this can be used as an alternative quick-and-dirty approach that can be cheaply incorporated into a tool.
For a more complete command-line parsing library, use [clap].
We provide: * A dependency-free command-line parsing framework using declarative macros. * A flexible mechanism for parsing. * Formatting of decent looking help messages.
We do not provide: * As-close-to correct line wrapping with wide unicode characters as possible (see [textwrap]). * Complex command structures like subcommands. * Parsing into [OsString]s. The default parser will panic in case not valid unicode is passed into it in accordance with [std::env::args].
For how to use, see the documentation of [argwerk::define] and [argwerk::parse].
This is available as a runnable example:
sh cargo run --example tour
```rust
let args = argwerk::parse! {
/// A command touring the capabilities of argwerk.
"tour [-h]" {
help: bool,
#[required = "--file must be specified"]
file: String,
input: Option
dbg!(args); ```
License: MIT/Apache-2.0