semver-sync 0.1.1

Keep one version across every crate in a cargo workspace; bumps are checked as docker tags before any manifest is written.
//! `semver-sync` — one version for every crate in a cargo workspace.

mod alias;
mod cli;
mod commands;
mod manifest;
mod version;
mod workspace;

use std::io::Write;

use clap::Parser;

use crate::cli::Cli;

/// A plain `String` error is enough: the message prints verbatim, and an empty
/// one means the details already reached stderr, one manifest at a time.
pub(crate) type Result<T, E = String> = std::result::Result<T, E>;

fn main() {
    if let Err(err) = commands::run(Cli::parse().command) {
        // An empty error means every manifest already reported its own.
        if !err.is_empty() {
            let _ = writeln!(std::io::stderr(), "semver-sync: {err}");
        }

        std::process::exit(1);
    }
}