xmpd/music_mgr/src/main.rs

30 lines
630 B
Rust
Raw Normal View History

2024-04-07 22:07:56 +00:00
use clap::Parser;
2024-04-08 00:03:35 +00:00
use crate::{cli::{CliArgs, CliCommand}, downloader::Downloader};
2024-04-07 22:07:56 +00:00
mod cli;
2024-04-08 00:03:35 +00:00
mod manifest;
mod logger;
mod downloader;
mod util;
2024-04-12 21:02:42 +00:00
mod commands;
mod prompt;
2024-04-07 22:07:56 +00:00
2024-04-08 00:03:35 +00:00
#[tokio::main]
async fn main() {
2024-04-12 21:02:42 +00:00
let mut cli_args = CliArgs::parse();
cli_args.populate_extra();
2024-04-08 00:03:35 +00:00
logger::init_logger(cli_args.debug);
2024-04-12 21:02:42 +00:00
2024-04-08 00:03:35 +00:00
let manifest = match manifest::Manifest::from_path(&cli_args.manifest.as_std_path()) {
Ok(m) => m,
Err(e) => {
log::error!("Failed to parse manifest file {}: {e}", cli_args.manifest);
return;
}
};
2024-04-12 21:02:42 +00:00
commands::command_run(&cli_args, &manifest);
2024-04-07 22:07:56 +00:00
}