argh
argh copied to clipboard
Unrecognized argument on raw identifier
Demo
use argh::FromArgs;
/// An example CLI application
#[derive(FromArgs)]
struct Example {
/// the type (as a usize) to be used
#[argh(option)]
r#type: usize,
}
fn main() {
let _up: Example = argh::from_env();
}
then folllowing cargo run -- --type 1 the output is:
warning: field is never read: `type`
--> src/main.rs:8:5
|
8 | r#type: usize,
| ^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: `arghtest` (bin "arghtest") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.33s
Running `target/debug/arghtest --type 1`
Unrecognized argument: --type