use clap::Parser;
use crate::{
bluetooth::BluetoothTUI,
cli::{Cli, MainCommands},
wifi::WifiTUI,
};
pub mod bluetooth;
pub mod cli;
pub mod wifi;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
let mut terminal = ratatui::init();
let result = match &cli.command {
Some(MainCommands::Bluetooth {}) => {
let mut bt_tui = BluetoothTUI::new();
let result = bt_tui.run(&mut terminal).await;
result
}
Some(MainCommands::Wifi {}) => {
let mut w_tui = WifiTUI::new();
let result = w_tui.run(&mut terminal).await;
result
}
None => Ok(()),
};
ratatui::restore();
result
}