use anyhow::Result;
mod config;
mod filter;
mod mainloop;
mod player;
mod service;
mod track;
use config::load_config;
use service::Service;
const VERSION: &str = env!("CARGO_PKG_VERSION");
fn main() -> Result<()> {
let arg = std::env::args().nth(1);
if let Some("-v" | "--version") = arg.as_deref() {
println!("rescrobbled v{VERSION}");
return Ok(());
}
let config = load_config()?;
if let Some("config") = arg.as_deref() {
println!("{:#?}", config);
return Ok(());
}
let services = Service::initialize_all(&config);
mainloop::run(config, services)
}