I woud say use a regex to find all the data, i.e use
command, -flag "param1" -blah "param2", and use \\ for a backslash, and \" for a quote.