Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized argument on raw identifier #124

Closed
dmgolembiowski opened this issue Mar 9, 2022 · 0 comments · Fixed by #186
Closed

Unrecognized argument on raw identifier #124

dmgolembiowski opened this issue Mar 9, 2022 · 0 comments · Fixed by #186

Comments

@dmgolembiowski
Copy link

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
xzfc added a commit to xzfc/argh that referenced this issue Jan 31, 2024
This changes argh_derive to allow using raw struct field identifiers
(e.g., `r#move`) as long names.

Closes google#124
sadmac7000 pushed a commit that referenced this issue Feb 1, 2024
This changes argh_derive to allow using raw struct field identifiers
(e.g., `r#move`) as long names.

Closes #124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant