MacPorts: use switch and if/else to extract key/value pairs