codeberg_cli/
run.rs

1use clap::Parser;
2
3use crate::{actions::BergCommand, types::config::BergConfig};
4
5pub async fn berg_main() {
6    tracing_subscriber::fmt::init();
7
8    if let Err(e) = BergCommand::parse().run().await {
9        let config = match BergConfig::new() {
10            Ok(config) => config,
11            Err(e) => {
12                eprintln!("{e:?}");
13                return;
14            }
15        };
16        let mut table = config.make_table();
17        table.add_row(vec![
18            comfy_table::Cell::new(format!("{e:?}")).fg(comfy_table::Color::Red)
19        ]);
20        eprintln!("{table}", table = table.show());
21    }
22}