generator: Code to handle optional arguments in daemon functions.