google / google/argh

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

Open
#163 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.