mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
Merge pull request #3893 from iwanders/add-comment-about-derive-feature
Add comment about requiring the derive feature.
This commit is contained in:
commit
9c81b39533
1 changed files with 7 additions and 6 deletions
13
README.md
13
README.md
|
@ -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 [..]
|
||||
|
|
Loading…
Add table
Reference in a new issue