#args #structopt

argst

A one-macro crate for generating StructOpt boilerplate and binding args

2 releases

0.1.1 Sep 29, 2020
0.1.0 Sep 7, 2020

#1571 in Rust patterns

MIT/Apache

7KB

argst

argst is a simple one-macro library which hides some of the boilerplate around StructOpt.

The only useful item in argst is the args macro.

See (or generate) crate documentation for more info.


lib.rs:

argst

argst is a simple one-macro library to hide some boilerplate when using StructOpt. See the actual args macro.

Example

use argst::args;
args!(
    /// The number of times to perform this operation
    #[structopt(long = "count")]
    n: usize,
    /// The path to the data file
    path: std::path::PathBuf,
);
println!("Running {} times over data at {}", n, path.display());

Dependencies

~2.5MB
~49K SLoC