def func_factory(p, method: str) -> callable:
    """
    Dynamically generates callback commands to correlate to provider public methods

    :param p: A :class:`notifiers.core.Provider` object
    :param method: A string correlating to a provider method
    :return: A callback func
    """

    def callback(pretty: bool = False):
        res = getattr(p, method)
        dump = partial(json.dumps, indent=4) if pretty else partial(json.dumps)
        click.echo(dump(res))

    return callback
Dynamically generates callback commands to correlate to provider public methods

    :param p: A :class:`notifiers.core.Provider` object
    :param method: A string correlating to a provider method
    :return: A callback func