Skip to content

Commit

Permalink
Merge pull request #3893 from iwanders/add-comment-about-derive-feature
Browse files Browse the repository at this point in the history
Add comment about requiring the derive feature.
  • Loading branch information
epage authored Jul 5, 2022
2 parents 4ecdd1a + ee6dc53 commit 9c81b39
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ Create your command-line parser, with all of the bells and whistles, declarative

### Example

This uses our
Add `clap` as a dependency with the `derive` feature enabled:
```console
cargo add clap -F derive
```

This allows using the
[Derive API](https://github.com/clap-rs/clap/blob/v3.2.8/examples/tutorial_derive/README.md)
which provides access to the [Builder API](https://github.com/clap-rs/clap/blob/v3.2.8/examples/tutorial_builder/README.md) as attributes on a `struct`:

Expand Down Expand Up @@ -60,11 +65,7 @@ fn main() {
}
}
```
Add this to `Cargo.toml`:
```toml
[dependencies]
clap = { version = "3.2.8", features = ["derive"] }
```

```bash
$ demo --help
clap [..]
Expand Down

0 comments on commit 9c81b39

Please sign in to comment.