a function to parse argv style arrays