Skip to content

Commit

Permalink
docs(commands): Add info about clap Derive API (#2066)
Browse files Browse the repository at this point in the history
Add information to contributing docs about using Derive API for future commands.
  • Loading branch information
elramen authored May 28, 2024
1 parent c805e5c commit f3cf487
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Adding new commands
For new commands, it is recommended to use clap's [Derive API](https://docs.rs/clap/latest/clap/_derive/index.html).
In contrast to the [Builder API](https://docs.rs/clap/latest/clap/_tutorial/index.html), the Derive API makes it:
- Easier to read, write, and modify commands and arguments.
- Easier to keep argument declaration and reading in sync.
- Easier to reuse shared arguments.

An existing example of how to use the Derive API is the `send-metric` command.

# Integration Tests

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/.
Expand Down

0 comments on commit f3cf487

Please sign in to comment.