main icon indicating copy to clipboard operation
main copied to clipboard

Best means of accepting a list of values

Open Wardrop opened this issue 7 years ago • 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?

Wardrop avatar Oct 20 '17 04:10 Wardrop