<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error_removed_option(message: str):
 """ Takes a message and returns a callback that raises NoSuchOption if the value is not None. The message is used as an argument to NoSuchOption. """

    def f(_, param, value):
        if value is not None:
            raise click.NoSuchOption(
                f'--{param.name.replace("_", "-")} is no longer a valid option. ' +
                message,
            )
    return f