@@ -66,7 +66,7 @@ In addition to this tutorial, see the [derive reference](../derive_ref/README.md
66
66
67
67
## Configuring the Parser
68
68
69
- You use the ` Command ` the start building a parser.
69
+ You use derive ` Parser ` the start building a parser.
70
70
71
71
[ Example:] ( 02_apps.rs )
72
72
``` console
@@ -89,7 +89,7 @@ MyApp 1.0
89
89
90
90
```
91
91
92
- You can use ` command!() ` to fill these fields in from your ` Cargo.toml ` file.
92
+ You can use ` #[clap(author, version, about)] ` attribute defaults to fill these fields in from your ` Cargo.toml ` file.
93
93
94
94
[ Example:] ( 02_crate.rs )
95
95
``` console
@@ -111,7 +111,7 @@ clap [..]
111
111
112
112
```
113
113
114
- You can use ` Command ` methods to change the application level behavior of clap.
114
+ You can use derive attributes to change the application level behavior of clap.
115
115
116
116
[ Example:] ( 02_app_settings.rs )
117
117
``` console
@@ -266,7 +266,7 @@ name: Some("bob")
266
266
267
267
### Subcommands
268
268
269
- Subcommands are defined as ` Command ` s that get added via ` Command:: subcommand` . Each
269
+ Subcommands are derived with ` Subcommand ` that get added via ` #[clap( subcommand)] ` attribute . Each
270
270
instance of a Subcommand can have its own version, author(s), Args, and even its own
271
271
subcommands.
272
272
@@ -326,7 +326,7 @@ SUBCOMMANDS:
326
326
327
327
```
328
328
329
- Because we set ` Command:: propagate_version` :
329
+ Because we added ` #[clap( propagate_version = true)] ` :
330
330
``` console
331
331
$ 03_04_subcommands_derive --version
332
332
clap [..]
@@ -339,8 +339,8 @@ $ 03_04_subcommands_derive add --version
339
339
### Defaults
340
340
341
341
We've previously showed that arguments can be ` required ` or optional. When
342
- optional, you work with a ` Option ` and can ` unwrap_or ` . Alternatively, you can
343
- set ` Arg::default_value ` .
342
+ optional, you work with an ` Option ` and can ` unwrap_or ` . Alternatively, you can
343
+ set ` #[clap(default_value_t)] ` .
344
344
345
345
[ Example:] ( 03_05_default_values.rs )
346
346
``` console
0 commit comments