Function run_with_changelog_modifier

Source
pub fn run_with_changelog_modifier(
    args: Opt,
    changelog_modifier: impl FnOnce(&mut Changelog<'_>) -> Result<()>,
) -> Result<()>
Expand description

Runs git-cliff with a changelog modifier.

This is useful if you want to modify the Changelog before it’s written or the context is printed (depending how git-cliff is started).

§Example

use clap::Parser;
use git_cliff::args::Opt;
use git_cliff_core::error::Result;

fn main() -> Result<()> {
    let args = Opt::parse();

    git_cliff::run_with_changelog_modifier(args, |changelog| {
        println!("Releases: {:?}", changelog.releases);
        Ok(())
    })?;

    Ok(())
}