def merge_config(args, config):
    """This function merges the args and the config together.
    The command line arguments are prioritized over the configured values.

    :param args: command line arguments
    :type args: dict
    :param config: option from the config file
    :type config: dict
    :return: dict with values merged
    """
    for key, value in args.items():
        if value is not None:
            config[key] = value

    if 'domain' not in config:
        config['domain'] = config['homeserver']

    return config