Skip to content

Commit f3cf487

Browse files
authored
docs(commands): Add info about clap Derive API (#2066)
Add information to contributing docs about using Derive API for future commands.
1 parent c805e5c commit f3cf487

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Adding new commands
2+
For new commands, it is recommended to use clap's [Derive API](https://docs.rs/clap/latest/clap/_derive/index.html).
3+
In contrast to the [Builder API](https://docs.rs/clap/latest/clap/_tutorial/index.html), the Derive API makes it:
4+
- Easier to read, write, and modify commands and arguments.
5+
- Easier to keep argument declaration and reading in sync.
6+
- Easier to reuse shared arguments.
7+
8+
An existing example of how to use the Derive API is the `send-metric` command.
9+
110
# Integration Tests
211

312
Integration tests are written using `trycmd` crate. Consult the docs in case you need to understand how it works https://docs.rs/trycmd/latest/trycmd/.

0 commit comments

Comments
 (0)