argh icon indicating copy to clipboard operation
argh copied to clipboard

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

Open stackinspector opened this issue 2 years ago • 3 comments

#[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

stackinspector avatar May 16 '23 17:05 stackinspector

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 avatar Jun 06 '23 15:06 rveerama1

@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.

rveerama1 avatar Aug 16 '23 11:08 rveerama1

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.

bruceg avatar Aug 07 '24 02:08 bruceg