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

#[argh(description = "...")] only supports literal #163

Open
stackinspector opened this issue May 16, 2023 · 3 comments
Open

#[argh(description = "...")] only supports literal #163

stackinspector opened this issue May 16, 2023 · 3 comments

Comments

@stackinspector
Copy link

#[derive(argh::FromArgs)]
#[argh(description = env!("GIT_HASH"))]
struct Args {}
error: expected literal
 --> arghdesc.rs:2:22
  |
2 | #[argh(description = env!("GIT_HASH"))]
  |                      ^^^

error: #[derive(FromArgs)] type with no description.
       Add a doc comment or an `#[argh(description = "...")]` attribute.
 --> arghdesc.rs:1:10
  |
1 | #[derive(argh::FromArgs)]
  |          ^^^^^^^^^^^^^^
  |
  = note: this error originates in the derive macro `argh::FromArgs` (in Nightly builds, run with -Z macro-backtrace for more info)

error: #[derive(FromArgs)] type with no description.
       Add a doc comment or an `#[argh(description = "...")]` attribute.
 --> arghdesc.rs:3:8
  |
3 | struct Args {}
  |        ^^^^

error: could not compile `snippets` due to 3 previous errors
@rveerama1
Copy link

Addition to support this idea of supporting more than string literal, we have some use cases for it. Based on the configuration features (e.g: feature tdx ) help text can have more details.
More details can be found here.

@rveerama1
Copy link

@erickt @sadmac7000 Hi, we have noticed few commits recently from you. Initially we thought there is no community activity on pull requests or issues addressed from Jan-Aug 2023. We have decided that our issue was not addressed and afraid if this inactivity continues in the future and if our dependency increases on this crate then we will end up with some issues. So we thought of shifting back to clap crate.

Complete details of our issue are here.

Please take a look and let us know your inputs.

@bruceg
Copy link
Contributor

bruceg commented Aug 7, 2024

This also impacts the name parameter to that statement. I have been using the derive in a macro that fills in the name and description parameters with macro parameters, and that broke in 0.1.11.

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

No branches or pull requests

3 participants