cover/src/main.rs

22 lines
598 B
Rust

use std::{env, fs};
use nanoserde::DeJson;
use cover::library::Library;
fn main() {
let file_path = env::args()
.nth(1)
.expect("Usage: cover path/to/library.json");
let json = fs::read_to_string(file_path).expect("Failed to open library file");
let library: Library =
DeJson::deserialize_json(&json).expect("Failed to deserialize library file");
for cover in library.library_covers() {
println!("Found cover!");
println!(
"{}, by {:?}, covered by {}",
cover.title, cover.writers, cover.performer
)
}
}