Merge pull request #3893 from iwanders/add-comment-about-derive-feature

Add comment about requiring the derive feature.
This commit is contained in:
Ed Page 2022-07-05 09:11:49 -05:00 committed by GitHub
commit 9c81b39533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`:
@ -60,11 +65,7 @@ fn main() {
}
}
```
Add this to `Cargo.toml`:
```toml
[dependencies]
clap = { version = "3.2.8", features = ["derive"] }
```
```bash
$ demo --help
clap [..]