Allow :cwd option to receive a string or a function