1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use clap::Parser;

use crate::{actions::BergCommand, types::config::BergConfig};

pub async fn berg_main() {
    tracing_subscriber::fmt::init();

    if let Err(e) = BergCommand::parse().run().await {
        let config = match BergConfig::new() {
            Ok(config) => config,
            Err(e) => {
                eprintln!("{e:?}");
                return;
            }
        };
        let mut table = config.make_table();
        table.add_row(vec![
            comfy_table::Cell::new(format!("{e:?}")).fg(comfy_table::Color::Red)
        ]);
        eprintln!("{table}");
    }
}