getopt long - Ruby GetoptLong how do I parse comma separated arguments? -
How can I parse subtle arguments in Ruby?
For example:
$> main.rb --xmlid 1,2,3,4,5
I used 1,2 in an array, I want to parse and archive 3,4,5.
How can I do this?
Thank you.
Once you know the ARGV
index in the list (in this case 1), use:
ARGV [index] .split (',') # = & gt; ["1", "2", "3", "4", "5"]
Comments
Post a Comment