-
Hi, I want to learn clap for command line parsing and I'm wondering why there are two different ways to do it. Whats the difference? Whats the preferred or recommended way? |
Beta Was this translation helpful? Give feedback.
Answered by
epage
Sep 5, 2024
Replies: 1 comment 1 reply
-
We briefly discuss which to use in our FAQ, see https://docs.rs/clap/latest/clap/_faq/index.html#when-should-i-use-the-builder-vs-derive-apis For most users, the main difference is whether you define your CLI through attributes on a struct and its fields or use a builder API. Nearly all of the builder functionality is exposed through the derive API. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MarkuBu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We briefly discuss which to use in our FAQ, see https://docs.rs/clap/latest/clap/_faq/index.html#when-should-i-use-the-builder-vs-derive-apis
For most users, the main difference is whether you define your CLI through attributes on a struct and its fields or use a builder API. Nearly all of the builder functionality is exposed through the derive API.