Clap: custom collection instead of Vec

โš“ Rust    ๐Ÿ“… 2025-06-30    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 4      

surdeus

Warning

This post was published 38 days ago. The information described in this article may have changed.

Hello Everybody,

I know I can parse multiple arguments in Clap into Vec<T> - for example clap/examples/escaped-positional-derive.rs at master ยท clap-rs/clap ยท GitHub

I also know I can use #[arg(last = true, value_parser = |inp: &str| ... with a function that will be applied on each T in Vec<T>.

But I can't figure out if I can somehow pass the whole collection/iterator to a function. For example if I want to get VecDeque<T> without converting it afterwards from Vec<T>. Is that possible?

Thank you.

1 post - 1 participant

Read full topic

๐Ÿท๏ธ rust_feed