0

Is there a way to pass multiple values per parameter using clap?

For instance, if I type this

$ ./app —-color red, green, blue -—height 100 200

or this

$ ./app —-color red —-color green —-color blue —-height 100 —-height 200

I should get this:

color: red, green, blue
height: 100, 200

I’m aware of the multiple(true) option, but I cannot figure out how to iterate multiple values like in the example above.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
beep
  • 1,057
  • 2
  • 11
  • 23
  • 1
    It looks like your question might be answered by the answers of [Taking multiple values in an argument in Clap](https://stackoverflow.com/q/48068334/155423). If not, please **[edit]** your question to explain the differences. Otherwise, we can mark this question as already answered. – Shepmaster Feb 08 '21 at 20:33
  • 2
    Oh I missed that answer! Yup, it definitely fits my needs. You can set it as already answered. – beep Feb 08 '21 at 20:50

0 Answers0