def int_option(options, name, default):
    """
    Returns an integer value of a command line option with `name` from `options` dictionary.

    Parameters
    ----------
    options : dict
        A dictionary containing command line options, where keys are the option names and values are the values.

    name : str
        The name of the command line option.

    default: int
        The default value of the command line option to use if it is missing in `options`.

    Returns
    -------
    int
        The value of the option.
    """

    if name in options:
        value = options[name]
        try:
            return int(value)
        except ValueError:
            print(f"ERROR: option '{name}' needs to be an integer number.")
            exit(1)
    else:
        return default