Split commandline arguments into groups