ahoward/main

Best means of accepting a list of values

Wardrop opened this issue · 0 comments

What's the correct was for an option to take a list of values, e.g.

myprogram --sources google facebook microsoft

or

myprogram --sources google,facebook,microsoft

In the first example, I can't seem to make this work as options aren't designed to take a list of values unless you repeat the option, e.g. myprogram --source google --source facebook --source microsoft, which can get verbose.

I can make the second example work by spliting on the comma and trimming whitespace, but is that the best solution here?

Might be worth covering this in the readme with a few examples?