Array type
would be nice to have default array parser like this:
struct MyArgs
include ArgParser
getter ids : Array(Int32)
end
args = MyArgs.new(["--ids", "1,2,3"])
Array's could be parsed a number of different ways, so I have a converter for that. Check out the CommaSeparatedArrayConverter.
You can also look here for a usage example
why not add it by default, to less typing.
I decided since an Array isn't a primitive in the same way int, float, string, and boolean are it made more sense to not give just one way to do it. This way they can use the provided converter if they want to format their arrays as comma separated values, or they can provide their own converter for a custom format.
Multiple of the same argument can also be used for Arrays, which is kind of the default. So:
-arg "hello" -arg "world" would add both hello and world to the array (assuming it is an array type)