argwerk_no_std::define! { /// A simple tool. #[usage = "tool [-h]"] struct Args { help: bool, limit: usize = 10, } /// The limit of the operation. (default: 10). ["-l" | "--limit", int] => { limit = str::parse(&int)?; } /// Print this help. ["-h" | "--help"] => { println!("{}", HELP); help = true; } } fn main() -> Result<(), argwerk_no_std::Error> { let args = Args::parse(std::env::args().skip(1))?; if args.help { return Ok(()); } dbg!(args); Ok(()) }