Skip to content

Multiple occurences with multiple values #5913

Answered by epage
emfax asked this question in Q&A
Discussion options

You must be logged in to vote

tl;dr run cargo add clap -F unstable-v5 but keep in mind the other breaking changes with that feature and that we may introduce more until we release clap v5.0.0.

Whats happening is the derive sees Vec<T> and treats that as multiple occurrences of T but clap doesn't know (and an attribute wasn't specified) to say how to parse Vec<PathBuf> out of a single value.

Multiple values per occurrence is generally handled as a flat structure (Vec<T>). We've slowly been adding support for grouping values per occurrence. Supporting this in the derive would technically be a breaking change (#4626) which won't be available until clap v5. We have implemented support for this behind the unstable-v5 featu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@emfax
Comment options

Answer selected by emfax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants