parse-options: make some arguments optional, add callbacks.