micpipe 0.1.0

Run a macOS microphone-to-BlackHole audio router as a background service.
mod audio;
mod cli;
mod error;
mod logging;
mod resampler;
mod router;
mod service;

use clap::Parser;
use cli::{Cli, Command};

fn main() {
    if let Err(err) = run() {
        eprintln!("{err}");
        std::process::exit(1);
    }
}

fn run() -> error::Result<()> {
    let cli = Cli::parse();
    match cli.command {
        Command::Run(args) => router::run(args),
        Command::Install(args) => service::install(args),
        Command::Uninstall => service::uninstall(),
        Command::Start => service::start(),
        Command::Stop => service::stop(),
        Command::Restart => service::restart(),
        Command::Status => service::status(),
    }
}