2025-12-27 01:48:17 -03:00
|
|
|
use anyhow::Result;
|
2025-04-28 19:02:32 -04:00
|
|
|
use clap::Parser;
|
|
|
|
|
|
|
|
|
|
pub mod cli;
|
2025-12-27 01:48:17 -03:00
|
|
|
pub mod constants;
|
|
|
|
|
pub mod directories;
|
2025-04-28 19:02:32 -04:00
|
|
|
pub mod editions;
|
|
|
|
|
pub mod lang;
|
2025-12-20 19:01:40 -03:00
|
|
|
pub mod logging;
|
|
|
|
|
pub mod malie;
|
2025-04-28 19:02:32 -04:00
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
|
let args = cli::Args::parse();
|
2025-12-27 01:48:17 -03:00
|
|
|
let log_mode = if args.command == cli::Command::Tui {
|
|
|
|
|
logging::LogMode::File
|
|
|
|
|
} else {
|
|
|
|
|
logging::LogMode::Print
|
|
|
|
|
};
|
|
|
|
|
logging::initialize_logging(log_mode).await?;
|
|
|
|
|
match args.command {
|
|
|
|
|
cli::Command::DownloadData => download_data().await?,
|
|
|
|
|
cli::Command::Tui => todo!(),
|
|
|
|
|
}
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async fn download_data() -> Result<()> {
|
|
|
|
|
let client = malie::client::Client::new().await?;
|
|
|
|
|
client.download_all_data().await?;
|
2025-04-28 19:02:32 -04:00
|
|
|
Ok(())
|
|
|
|
|
}
|