Add support for repeatable array options#159
Conversation
Support repeatable :array options (in addition to comma-separated) ``` option :deps, type: :array # Before --deps=foo --deps=bar options[:deps] # => ["bar"] # After --deps=foo --deps=bar options[:deps] # => ["foo", "bar"] ```
|
I very much like the direction and I was missing ability to specify API like curl's multiple I believe what would be desired in reality is to have either plural and comma-separated, or singular multiple times. So: This makes me think they are not, in fact, interchangeable. Maybe instead of reusing Please, don't take it as a change request straight away. I'd like it to be discussed first. |
|
Hey @katafrakt, thanks a lot for the thoughtful feedback! 😄 My intention indeed was to mimic other common CLI tools - so definitely no coincidence that this is very similar to
I can see where you're coming from... Indeed the example with repeatable pluralized options is a bit unfortunate. Also, not sure if that's what you suggested, but having an actual decent pluralization built-into array types would probably be tricky, so my vote would be against that direction (and options already support
Funny you mentioned that :) my initial implementation was using a new For context: I didn't want to inadvertently make the description too big (especially since Here's my original solution using a |
Support repeatable :array options (in addition to comma-separated)
E.g.:
Related: