cuddle-v2/cuddle/src/main.rs
kjuulh 2cd9509fcb
feat: rename cuddle_cli -> cuddle
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-12 21:41:07 +02:00

32 lines
619 B
Rust

use config::CuddleConfig;
use tracing_subscriber::prelude::*;
use tracing_subscriber::{fmt, EnvFilter};
mod actions;
mod cli;
mod config;
mod context;
mod model;
mod util;
fn main() -> anyhow::Result<()> {
init_logging()?;
let _ = dotenv::dotenv();
let config = CuddleConfig::from_env()?;
let context = context::extract_cuddle(config.clone())?;
_ = cli::CuddleCli::new(context, config)?.execute()?;
Ok(())
}
fn init_logging() -> anyhow::Result<()> {
tracing_subscriber::registry()
.with(fmt::layer())
.with(EnvFilter::from_default_env())
.init();
Ok(())
}