You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use argh::FromArgs;/// An example CLI application#[derive(FromArgs)]structExample{/// the type (as a usize) to be used#[argh(option)]r#type:usize,}fnmain(){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
The text was updated successfully, but these errors were encountered:
xzfc
added a commit
to xzfc/argh
that referenced
this issue
Jan 31, 2024
Demo
then folllowing
cargo run -- --type 1
the output is:The text was updated successfully, but these errors were encountered: