commit-wizard 0.0.2

A lightweight CLI assistant for Conventional Commits, semantic versioning, and changelog automation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::process::ExitCode;

use crate::engine::Error;

pub type CoreResult<T> = Result<T, Error>;

pub fn report_error(err: &Error) {
    eprintln!("{}: {}", err.code.id(), err.message);
    for (key, value) in &err.context {
        eprintln!("  {key}: {value}");
    }
}

pub fn exit_code(err: &Error) -> ExitCode {
    ExitCode::from(err.exit_code() as u8)
}